window环境下mysql导入sql文件时报错:ERROR: ASCII '\0' appeared in the statement

错误信息:

ERROR: ASCII ‘\0‘ appeared in the statement, but this is not allowed unless option --binary-mode is enabled and mysql is run in non-interactive mode. Set --binary-mode to 1 if ASCII ‘\0‘ is expected. Query: ‘蘒‘.

解决方案:

1、使用ultraedit打开sql文件

2、查看文件编码方式(我的是UTF-16)

3、点击文件->另存为->修改编码方式为UTF-8(数据库的编码方式)即可

 

再次执行:

mysql -uroot -p testDb < test.sql

 

随记:

mysql导出文件:mysqldump -uroot -p testDb > test.sql

文章来自:http://www.cnblogs.com/quanenmin/p/6377776.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3