mysql导出binlog

如何导出binlog
cd mysql bin 目录

./mysqlbinlog/home/mydata/mysql-bin.000157 --result-file=/var/mysql_bin_log/binlog_bak_201905301349/mysql-bin.000157.sql

binlog 无法直接
cat xxxx.bin | grep xxx

只能先导出来再查看。
可导出指定时间范围内的 binlog

./mysqlbinlog --no-defaults--start-datetime='2019-05-27 00:00:00' --stop-datetime='2019-05-29 00:00:00'/home/mydata/mysql-bin.000142 --result-file=/var/mysql_bin_log/mysql-bin.000142.sql

【mysql导出binlog】

    推荐阅读