码迷,mamicode.com
首页 > 数据库 > 详细

mysql bin日志配置及查看

时间:2017-01-24 11:11:47      阅读:319      评论:0      收藏:0      [点我收藏+]

标签:update   /var   开始时间   设置   var   server   ``   begin   int   

mysql执行sql可以通过设置mysql bin 日志进行记录查看,mysql bin日志配置如下:
 
log_bin:on
log_bin_basename:bin文件路径及名前缀(/var/log/mysql/mysql-bin)
log_bin_index:bin文件index(/var/log/mysql/mysql-bin.index)
server_id:n
 
生成的bin日志如:mysql-bin.000000  mysql-bin.000001
 
通过mysqlbinlog mysql-bin.000000 > mysql-bin.000000.txt 转换格式
日志内容:
 
use `aayongche`/*!*/;
SET TIMESTAMP=1485064811/*!*/; //开始时间
insert into `users` (`userId`, `userName`) values (28396, helly) //操作sql
/*!*/;
# at 38524047
#170122 14:00:11 server id 1  end_log_pos 38524078 CRC32 0xe8f99830     Xid = 23583291  //服务器id
COMMIT/*!*/;
# at 38524078
#170122 14:00:22 server id 1  end_log_pos 38524167 CRC32 0x64c7f33a     Query    thread_id=63112    exec_time=0    error_code=0
SET TIMESTAMP=1485064822/*!*/;
BEGIN
/*!*/;
# at 38524167
#170122 14:00:22 server id 1  end_log_pos 38524482 CRC32 0x3ff38ff2     Query    thread_id=63112    exec_time=0    error_code=0
SET TIMESTAMP=1485064822/*!*/;
users update `` set `userName` = heheli where `userId` = 28396
/*!*/;
# at 38524482

 

mysql bin日志配置及查看

标签:update   /var   开始时间   设置   var   server   ``   begin   int   

原文地址:http://www.cnblogs.com/niejunlei/p/6346568.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!