kiko2014551511

 

a、使用sql命令查看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]

 

b、使用mysqlbinlog查看binlog文件内容

 

1、输出指定binlog文件内容

  mysqlbinlog binlog文件

 

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

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

 

 3、输出指定position位置的binlog日志到指定文件中

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

或者

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

 

4、输出指定position位置的binlog日志到压缩文件中

 mysqlbinlog --start-position="指定开始位置" --stop-position="指定结束位置" binlog文件|gzip > 压缩文件名

 

5、输出指定开始时间的binlog日志

mysqlbinlog --start-datetime="yyyy-MM-dd HH:mm:ss" binlog文件 

 

 

 

 

参考地址

查看binlog文件的2种方式 https://blog.csdn.net/u010433704/article/details/54962680

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
  • 2021-12-18
  • 2021-12-27
  • 2022-01-07
  • 2022-03-12
猜你喜欢
  • 2022-12-23
  • 2022-01-04
  • 2021-12-14
  • 2021-10-25
  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
相关资源
相似解决方案