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
utf8 as below
If you are using an SQL dump file, then open it with a text editor and replace all occurrences of
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.