Mysqldump and Error “Unknown command ‘\0′”
- July 26th, 2010
- Posted in Linux . PHP
- By Mr. Nerd
- Write comment
When you’re using mysqldump to put a complete database into a textfile and try to import that file into another MySQL server, you might come across the error message “Unknown command ‘\0‘” on importing the database.
The most probable cause to this is a database which contains (large) blobs, as they somehow might not get encoded to the right format.
Easy solution to this problem: Use the –hex-blob option:
mysqldump -uusername -p --hex-blob db_name > db_name.sql
This will force mysqldump to encode all blobs in binary format, which won’t get messed up in encoding problems.