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

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、

猜你喜欢

转载自www.cnblogs.com/kiko2014551511/p/11649336.html