mysql ascii error
Category

Fix “ERROR: ASCII ‘\0’ appeared in the statement”

You might be stuck to an issue where you took a dump of the database in MySQL from one server, and when importing at another location you are facing issues like “ERROR: ASCII ‘\0’ appeared in the statement”. I myself faced this issue recently and resolved this just by creating a dump using the below command.

mysqldump -h'your_host' -u your_user_name -p'your_password' your_database_name --single-transaction | sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' | gzip > your_dump.sql.gz

When you successfully took the dumps, you can import them elsewhere using the below command in the terminal.

zcat your_dump.sql.gz | mysql -u your_username -pyour_password your_database_name

Hope this helps someone

Happy Coding 🫶

Leave a Reply

Your email address will not be published. Required fields are marked *