开启bin-log
找到my.ini文件,在[mysqld]后面增加如下两行:
log-bin=mysql-bin
binlog-format=Row
查看bin-log配置信息
show variables like 'log_%';
查看bin-log文件信息
mysqlbinlog --no-defaults -vv mysql-bin.000001
或
show binlog events
生成还原bin-log 的mysql
//mysqlbinlog --no-defaults --start-position=4 --stop-position=641 mysql-bin.000001 > bak.sql