– log文件列表
show binary logs;
– 可查看log文件路径
show variables like ‘%log_bin%’;
– 正在使用的log文件
show master status;
– 生成新log文件
flush logs;
– 查看文件信息
show binlog events in ‘binlog.000002’;

mysqlbinlog工具常用参数
–start-datetime 查询起始时间戳。
–stop-datetime 查询终止时间戳。
–start-position binlog的偏移量起始值
–stop-position binlog的偏移量终止值
–database 查询指定数据库的log日志
-v 重新构建伪SQL语句的行信息输出
-vv 会增加列类型的注释信息

例:mysqlbinlog --start-position 1640 D:\work\binlog.000003 -d t -v -r D:\work\binlog.000003.sql

insert into zzz values (3,'h33',FROM_UNIXTIME(1668100884,'%Y-%m-%d %h:%i:%s')),
(4,'h4',FROM_UNIXTIME(1668101006,'%Y-%m-%d %h:%i:%s'))