正文
mysqlbinlog 查看binlog时报错unknown variable 'default-character-set=utf8'
小程序:扫一扫查出行
【扫一扫了解最新限行尾号】
复制小程序
【扫一扫了解最新限行尾号】
复制小程序
mysqlbinlog --no-defaults mysql-bin.000003 > /home/3.sql
下侧文字转自 http://www.cnblogs.com/cobbliu/p/4311926.html
原因是mysqlbinlog这个工具无法识别binlog中的配置中的default-character-set=utf8这个指令。
两个方法可以解决这个问题
一是在MySQL的配置/etc/my.cnf中将default-character-set=utf8 修改为 character-set-server = utf8,但是这需要重启MySQL服务,如果你的MySQL服务正在忙,那这样的代价会比较大。
二是用mysqlbinlog --no-defaults mysql-bin.000004 命令打开