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

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

Just got MySQL Error: "ASCII '\0' appeared in the statement, but this is not allowed unless option --binary-mode", this topic is about how to solve it.

 

{ Error Message }

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

 

{ Reason }

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

after deep check, the problem is because using gzip in output, so it's not SQL format file, it's .sql.gz file, just need one unzip.

 

{ Solution }

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

 

change back to gz, do unzip, then source command is working