This post is archived and may contain outdated information. It has been set to 'noindex' and should stop showing up in search results.
WordPress Unknown Collation utf8mb4_unicode_520_ci Solution
Sep 30, 2017Web DevelopmentComments (5)
If you're importing or migrating your WordPress database to a server that has an older version of MySQL (like version 5.5.x), you may run into this error:

Unknown collation: utf8mb4_unicode_520_ci
The utf8mb4_unicode_520_ci collation is available in MySQL versions 5.6.x and newer, and WordPress utilizes that collation if it's available during installation. To be able to successfully import or migrate to a server with an older MySQL version, you have one of three options:

Option 1
The best solution is to upgrade the server to a more recent version of MySQL that supports utf8mb4_unicode_520_ci, or ask your host to do it for you. This will ensure the best data integrity for your migration.

Option 2
If exporting from the old server using PHPMyAdmin, choose the advanced option to export to an older MySQL server:

MySQL Export Old Version

Option 3
If you have the exported .sql file, you can do a simple Find & Replace using a text editor such as Notepad++, replacing all occurrences of utf8mb4_unicode_520_ci with utf8mb4_unicode_ci:

Notepad++ Replace
Comments (5)
Add a Comment
Paul   Aug 19, 2020
Thanks for help!
Marcin   Jul 06, 2020
You are a fine scholar and gentleman. Thank you, sir!
Marco   Jul 12, 2019
Thank you so much, solution #3 was easy and simple and worked :)   Jul 04, 2018
I solved the problem by following your solution. Thanks 1000 !!!
Peter   Feb 27, 2018
That third option is going to cause all sorts of hell to break loose if you have data in the export that is actually *using* the utf8mb4_unicode_520_ci collation...