Forum archive › MySQL / MariaDB
ArchiveERROR 1273 (HY000): Unknown collation: ‘utf8mb4_0900_ai_ci\'
Problem
User tries to import a database file to MySQL and gets the following error
ERROR 1273 (HY000) at line 30: Unknown collation: ‘utf8mb4_0900_ai_ci'
the Problem occurs because of MySQL server running on the destination is an older version than the source.
Solution
Edit your database file with VI and run the following commands
:
g/utf8mb4_0900_ai_ci/s//utf8mb4_general_ci/g
g/CHARSET=utf8mb4/s//CHARSET=utf8/g
or use sed if your file is big with the following commands
sed ’s/utf8mb4_0900_ai_ci/s//utf8mb4_general_ci/' YOUR_DATABASE_FILE.sqlsed ’s/CHARSET=utf8mb4/s//CHARSET=utf8/' YOUR_DATABASE_FILE.sql
We do this for a living.
Kubernetes, DevOps and platform engineering, delivered in days — not another weekend lost to a stack trace.
Start a project →