查看mysql的bin-log日志

爱⌒轻易说出口 提交于 2019-11-30 14:23:05

1、查看有哪些binlog

show binary logs;

show master logs;

 

 

2、如何查看log_bin中的内容

show binlog events;

查看第一个binlog的内容,看看有哪些内容。

 

3、指定查看具体的binlog日志的内容

show binlog events in 'mysql-bin.000002';

show binlog events in 'mysql-bin.000003';

 

4、查看当前正在写入的binlog日志文件

因为一般都是在配置主从的时候,才需要用到binlog日志

show master status;

 

 

5、查看是否开启了binlog日志文件

show variables like 'log_bin';

 

select @@log_bin

 

 

6、查看binlog的日志和名称

show variables like '%log_bin%';

 

 

7、重新开始一个日志文件

flush logs;

重启mysql的话,也会产生一个新的bin log日志。

文章来源:运维公会--查看mysql的bin-log日志

 

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