Error on re-import: #1231 - Variable 'character_set_client' can't be set to the value of 'NULL' Using phpMyAdmin, I was getting an error when importing a MySQL dump file to which I'd made a simple global find-and-replace:

Error
SQL query:

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */
MySQL said:

#1231 - Variable 'character_set_client' can't be set to the value of 'NULL'


The strange thing is I had just exported the dump, and this is all I did.

So then I tried exporting a .zip again, and re-importing without making any changes. And I got the same error.

I was able to import the file, finally, by deleting these lines from the dump:

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;


But I'd like the export/import process to just work.

So my question is: How can I prevent this from happening with future imports, in a way that doesn't require looking up this issue again?

Note: I'm on a shared server setup; I don't currently have SSH access.
Not a user of phpMyAdmin, but mysqldump has an option to disable those lines from the dump:


--skip-set-charset


Unfortunately, this will work if you have access to mysqldump. Not sure if phpMyAdmin has configurable options for export, but hope this helps.