was successfully added to your cart.

How To Fix “unknown collation utf8mb4_unicode_520_ci” Error in phpmyAdmin

By October 18, 2016Web

If you are trying to import an SQL database into phpmyAdmin and receiving the error #1273 – unknown collation ‘utf8mb4_unicode_520_ci’ then you have come to the right place!

How To Fix "unknown collation utf8mb4_unicode_520_ci" Error

This error was a real pain in the ass to fix because all of solutions I found on stackoverflow and on other websites did not work or caused the WordPress site to change.

The cause of this issue is when export a database from MySQL 5.5.3 or newer which uses utf8mb4 encoding to an older version that uses utf8.

The best solution is to upgrade the older version of MySQL, but this is not always an option.
Alternatively, you can use the method below to import your database without receiving the #1273 โ€“ unknown collation โ€˜utf8mb4_unicode_520_ciโ€™ error.

 

How To Fix “unknown collation utf8mb4_unicode_520_ci” Error:

1. Download and install NotePad++ or a code editor of your choice.

2. Right-click on the database file and click on Edit with Notepad++.

Database - Edit With Notepad ++

2. Press the Ctrl key together with the F key on your keyboard to open up the Find box.

 
3. Click on the Replace tab.

Database - Edit With Notepad++ Replace

 
4. In the Find what: box enter utf8mb4_unicode_520_ci
In the Replace with: box enter utf8mb4_unicode_ci

Database - NotePad++ Find and Replace

 
5. Press the Replace All button.

Database - Edit With Notepad++ Replace All

6. Save the file and import it into phpmyAdmin.

 
If you are getting an error saying that the Table already exists, then you will need to drop the tables that were imported on your first attempt before importing your edited version.

Database unknown collation utf8mb4_unicode_520_ci Drop Tables

 
Did you manage to fix the annoying “unknown collation utf8mb4_unicode_520_ci” error?

10 Comments

Share Your Thoughts