Mysql – How to convert a MySQL database from utf8mb4 to utf8

character-setcollationMySQLtype conversionutf-8

I would like to convert a MySQL database, which has utf8mb4 character set and utf8mb4_unicode_cicollation, to utf8 and utf8_unicode_ci.

How to do that please?

Thank you in advance for your suggestions.

Best Answer

I just solved the charset problem by using Notepad++.

The problem was that my php version is 4.5.5.1 and the hosting firm's was 3.3.8. Because of that, it could not work with the utf8mb4_unicode_520_ci.

To solve the problem open the exported SQL file, search and replace the utf8mb4 with utf8, after that search and replace the utf8mb4_unicode_520_ci with utf8_general_ci. Save the file and import it into your database. After that, change the wp-config.php charset option to utf8, and the magic starts.

Note that it worked in a Hungarian database.