ERROR: File is not a binary log file

mysqlbinlog -v --start-datetime="2019-12-16 19:28:00" --stop-datetime="2019-12-16 20:15:59" mysql-bin.000139
mysqlbinlog读取binlog文件报错:
ERROR: File is not a binary log file

查找原因发现:
该binlog文件导出的指令使用的是:
mysqlbinlog -uroot -p123456 -h192.168.1.8 -P3306 --read-from-remote-server mysql-bin.000139 > binlog.000139

应该使用:
mysqlbinlog -uroot -p123456 -h192.168.1.8 -P3306 --read-from-remote-server --raw mysql-bin.000139
这样导出的文件才是二进制格式的binlog

You may also like...

发表评论