I would like to convert a MySQL database, which has utf8mb4
character set and utf8mb4_unicode_ci
collation, to utf8
and utf8_unicode_ci
.
How to do that please?
Thank you in advance for your suggestions.
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.
Sign up to join this communityI would like to convert a MySQL database, which has utf8mb4
character set and utf8mb4_unicode_ci
collation, to utf8
and utf8_unicode_ci
.
How to do that please?
Thank you in advance for your suggestions.
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.
utf8mb4_unicode_520_ci
with utf8_general_ci
first as if you do the first search and replace with utf8mb4
with utf8
it will overwrite the first replace and cause utf8_unicode_520_ci
to be created
Run in PhpMyAdmin:
ALTER DATABASE yourdatabasename CHARACTER SET utf8 COLLATE utf8_unicode_ci