mysql如何查binlog日志

一.用show binlog命令查看

登录mysql

mysql -uroot -ppassword

查看日志,from pos表示起始位置,可省略

mysql> show binlog events in 'mysql-bin.000106' from 0 limit 10\G;

二.用mysqlbinlog命令查看

1.时间段查询

mysqlbinlog --no-defaults --start-datetime='2019-07-04 00:00:00' --stop-datetime='2019-07-04 00:30:00' -d ai /db_tag/mysql/data/mysql-bin.000106 -v

2.pos段查询

mysqlbinlog --no-defaults --start-position=643333405 --stop-position=653333405 -d ai /db_tag/mysql/data/mysql-bin.000106 -v

你可能感兴趣的:(mysql相关)