binlog

Log

确认mysql打开了binlog日志:
show variables like '%log_bin%';
启动log-bin的方法:
编辑/etc/my.cnf
添加: log-bin=mysql-bin
确认binlog日志的级别为ROW类型:
show variables like 'binlog%';
更改级别的方法:
编辑/etc/my.cnf
添加 : binlog_format=ROW

mysql获取binlog文件列表:
show binary logs
查看当前正在写入的binlog文件:
show master status
查看master上的binlog:
show master logs
手动刷新日志,生成新的binlog文件:
flush logs
清空binlog文件:
reset master
查看binlog日志:
mysqlbinlog mysql-bin.00001
查看指定binlog文件内容:
show binlog events in 'mysql-bin.00001';

原文地址:https://www.cnblogs.com/jiayan666/p/14282970.html