一、mysql bin日志配置:

查案命令:show variables like '%log_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 `dbname`/*!*/;
SET TIMESTAMP=/*!*/; //开始时间
insert into `users` (`userId`, `userName`) values ('', 'helly') //操作sql
/*!*/;
# at 38524047
#170122 :: server id 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` = ''
/*!*/;
# at 38524482

最新文章

  1. win10 64位专业版系统中显示32位dcom组件配置的方法
  2. Bungee Jumping[HDU1155]
  3. struct和typedef struct彻底明白了
  4. Hadoop启动报Error: JAVA_HOME is not set and could not be found解决办法
  5. [51单片机] TFT2.4彩屏1 [文字显示 画矩形]
  6. [moka同学笔记]yii2.0导航栏
  7. tp三大自动
  8. CMOS and BIOS
  9. HTML要点(五)<iframe>标签
  10. GridLookUpEdit 简单应用
  11. 2016.08.06计算几何总结测试day1
  12. Python之旅.第三章.函数3.28
  13. jQuery的JS库在本地运行项目时提示无法加载
  14. git 配置别名
  15. 微信小程序使用三元表达式切换图片
  16. bzoj5068: 友好的生物
  17. 苹果Mac OS系统修改Hosts文件的方法
  18. 揭开AutoRun功能的神秘面纱
  19. xgboost使用
  20. 详解 MNIST 数据集

热门文章

  1. SpringMVC使用校验validator校验对象属性
  2. HDU 1027 Ignatius and the Princess II(求第m个全排列)
  3. 【SQLSERVER学习笔记】分页存储过程+调用
  4. git日常基本用法
  5. 【转载】python发送邮件实例
  6. 记录一次没有收集直方图优化器选择全表扫描导致CPU耗尽
  7. 新手Linux命令学习
  8. 移动端利用canvas画布简单实现刮刮乐效果
  9. Spring : JDBC模板, 事务和测试
  10. 第1天 Java基础语法