#1273 - Unknown collation: 'utf8mb4_unicode_ci' cPanel
I have a WordPress database on my local machine that I want to transfer to a hosted phpMyAdmin on cPanel. However, when I try to import the database into the environment, I keep getting this error:
#1273 - Unknown collation: 'utf8mb4_unicode_ci'
I have tried to Google around and the only solution I can find is this one phpmysql error - #1273 - #1273 - Unknown collation: 'utf8mb4_general_ci' which as by now isn't much help. I have tried clearing the cookies but it still won't work. Please help!
The technique in this post worked for me
1) Click the "Export" tab for the database
2) Click the "Custom" radio button
3) Go the section titled "Format-specific options" and change the dropdown for "Database system or older MySQL server to maximize output compatibility with:" from NONE to MYSQL40.
4) Scroll to the bottom and click "GO".
I'm not certain if doing this causes any data loss, however in the one time I've tried it I did not notice any. Neither did anyone who responded in the forums linked to above.
Edit 8/12/16 - I believe exporting a database in this way causes me to lose data saved in Black Studio TinyMCE Visual Editor widgets, though I haven't ran multiple tests to confirm.
If you have already exported a .sql
file, the best thing to do is to Find and Replace the following if you have them in your file:
-
utf8mb4_0900_ai_ci
toutf8_unicode_ci
-
utf8mb4
toutf8
-
utf8_unicode_520_ci
toutf8_unicode_ci
It will replace utf8mb4_unicode_ci
to utf8_unicode_ci
. Now you go to your phpMyAdmin cPanel and set the DB collation to utf8_unicode_ci
through Operations > Collation.
If you are exporting to a .sql
, it's better to change the format on how you're exporting the file. Check out Evster's anwer (it's in the same page as this)