Solution of error with binary-mode when importing MySQL dump from the command line

Once I decided to import sql dump:

mysql -u root database < database.sql.gz

And I noticed the following error:

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

The error occurs because the dump is compressed and must first be unpacked:

gunzip database.sql.gz

And then import:

mysql -u root database < database.sql

See my other articles in the category MySQL

Leave a comment

Leave a Reply

Discover more from IT Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading