2019-11-22 15:01:33 0 评论 MySQL Boy.Lee

MySQL错误:ASCII '\0' appeared in the statement, but this is not allowed unless option --binary-mode

遇到了MySQL错误: "ASCII '\0' appeared in the statement, but this is not allowed unless option --binary-mode", 记录下解决过程。

 

{ 错误信息 }

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: ''.
Bye

 

{ 错误原因 }

[root@MyServer tmp]# ......./mysqldump -uroot -pxxxx lm951 | gzip > lm951_2019-11-15-001.sql

仔细看了一下,在导出的时候实用了gzip压缩,但是保存的格式却是SQL, 所以导致无法使用,实际的导出格式是.sql.gz, 做一次解压缩就好了

 

{ 解决方法 }

mv lm951_2019-11-15-001.sql lm951_2019-11-15-001.sql.gz
gzip -d lm951_2019-11-15-001.sql.gz

source .../lm951_2019-11-15-001.sql

 

改回gz格式做一次解压缩,即可正常导入mysql数据