Mysql ERROR: ASCII '\0' while importing sql file on linux server

zish picture zish · Jul 14, 2016 · Viewed 34.9k times · Source

I am getting following error while importing sql file

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

HELP NEEDED...!!

Answer

Eric BELLION picture Eric BELLION · Jul 15, 2016

Try something like :

mysql -u root -p -h localhost -D database --binary-mode -o < dump.sql

and make sure your sql file is not zipped.