How to fix Unknown collation: ‘utf8mb4_unicode_520_ci’

Unknown collation is probably caused because your local and live server are running different versions of MySQL. This problem mostly comes when you migrate websites between servers. The error message looks like this:

**ERROR** database error write Unknown collation: 'utf8mb4_unicode_520_ci'
#1273 – Unknown collation: ‘utf8mb4_unicode_520_ci’

How to solve the problem?

You can solve the problem with a few different ways. An easy way is updating your MySQL on the new server but not everyone can do that.

The second solution is in the SQL file. Open the sql file in your text editor and follow these steps:

  1. Search: utf8mb4_unicode_ci 
    Replace: utf8_general_ci (Replace All)
  2. Search: utf8mb4_unicode_520_ci 
    Replace: utf8_general_ci (Replace All)
  3. Search: utf8mb4 
    Replace: utf8 (Replace All)

The third solution is working with SQL file as well. Find in your .sql file this row:

ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;

and replace it with

ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

If you have a PHPMyAdmin, you can follow steps below:

  1. Click the Export tab for the database
  2. Click the Custom radio button.
  3. Go the section titled Format-specific options and set the dropdown button to MYSQL40.
  4. Scroll to the bottom and click GO.

 

Is it your unknown collation problem solved now? Write down your comment on which solution works for you.

UNLIMITED DOWNLOADS: 50+ Million Website Templates & Design Assets

All the Website Templates you need and many other design elements, are available for a monthly subscription by subscribing to Envato Elements. The subscription costs $16.50 per month and gives you unlimited access to a massive and growing library of over 50 million items that can be downloaded as often as you need (stock photos too)!

Recent Articles

How to Hide “Add to Cart” Button in WooCommerce Quickly

Once on your project, you will maybe need to disable selling products, make a catalog from your e-commerce store, or simply hide...

Agronix – Organic Farm Agriculture WordPress Theme [Free WordPress theme download]

Demo Download Agronix – Organic Farm WordPress Theme. We are Happy to presenting you the Agronix Agriculture Farming WordPress Theme. It is very easy to customize...

Roux – Creative Portfolio WordPress Theme [Free WordPress theme download]

Demo Download This is Roux, a splash of vibrant creativity your beautiful new website needs! Roux comes with tons of creative portfolio, gallery and graphic...

Brico – Plumber WordPress Theme [Free WordPress theme download]

Demo Download Features Overview Drag and drop page builder – Elementor One click install demo Demo content included WPML, RTL...

Get in touch

Be our first-class reader, build a community and follow us on social media!

1 Comment

Leave A Reply

Please enter your comment!
Please enter your name here