mysql bin-logrow模式,base64转正常sql

可以通过以下命令查看日志是否开启查看

show global variables like '%log%';

当bin-log的模式设置为row时

不仅日志长得快 , 并且查看执行的sql时 , 也稍微麻烦一点:1.干扰语句多; 2生成sql的编码需要解码

此时需要加上参数 base64-output

--base64-output=decode-rows -v

例如:

/opt/mysql/bin/mysqlbinlog  --base64-output=decode-rows -v --start-date='2014-09-16 14:00:00' --stop-date='2014-09-16 14:20:00'  /opt/mysql/log/mysql-bin.000017 >/opt/mysql_bak/mysqlbinlogsql_restore.sql