查看mysql二进制文件(binlog文件)

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-01 02:48:09

1、获取binlog文件列表

mysql> show binary logs;

 

 

 2、查看当前正在写入的binlog文件

mysql>show master status;

 

 3、查看指定binlog文件的内容

 mysql>show binlog events [in 'log_name'] [FROM pos] [limit [offset,] row_count]

 

 

使用mysqlbinlog查看binlog

1、输出指定binlog文件内容

  mysqlbinlog binlog文件

 

 2、输出指定position位置的binlog日志

mysqlbinlog --start-position="指定开始位置" --stop-position="指定结束位置" binlog文件

 

 

 2、提取指定position位置的binlog日志并输出到指定文件中

mysqlbinlog --start-position="指定开始位置" --stop-position="指定结束位置" binlog文件 > 输出文件名

或者

mysqlbinlog --start-position="指定开始位置" --stop-position="指定结束位置" binlog文件 --result-file=输出文件名

 

 

3、

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!