show variables like "%log_bin%";
show master status;
show binlog events in 'binlog.000020';
–start-position=起始的pos
–stop-position=结束的Pos
D:/mysql-8.0.29-winx64/data/binlog.000020 binlog所处位置的路径
这个命令需要在mysql 命令行中执行,我们进入到mysql 安装目录的 bin 目录
mysqlbinlog --no-defaults --start-position=185742 --stop-position=186803 D:/mysql-8.0.29-winx64/data/binlog.000020 | mysql -uroot -p