Sometimes when importing a database dump from another MySQL server or executing an SQL query that uses a collation, you might encounter Unknown collation errors something like below

ERROR 1273 Unknown collation: ‘utf8mb4_0900_ai_ci’
ERROR 1273 Unknown collation: ‘utf8mb4_unicode_520_ci’
ERROR 1273 Unknown collation: ‘utf8mb4_unicode_ci’


Quickest solution to resolve this error is to replace the collation value in SQL query with below


If this does not work, then change the encoding from utfmb4 to utf8 as below


If you are using an SQL dump file, then open it with a text editor and replace all occurrences of utf8mb4_0900_ai_ci with utf8mb4_general_ci.


Main reason that this error occurs is due to version mismatch between MySQL server from which the dump was exported and on which it is imported.
Older versions of MySQL do not support utf8mb4 encoding and you are using it, this is another reason that raises the error.

Hit the clap if the article was useful.

Liked the article ? Spread the word...

This Post Has One Comment

  1. Y

    Wow! After all I got a weeb site from where I can inn fact obtain useful
    ddata concerning my study and knowledge.

Leave a Reply