I took a dump of a database with stored procedures using Export data wizard in WorkBench. So I was ready to import all data from the SQL file. I use XAMPP to set up a localhost server and PHPMyAdmin.
The Problem
SQL file was having a bit large size of 130MB so I followed a few steps first to increased upload limit in PHPMyAdmin tool which is usually set to max 20MB’s. After that, I started the process of Import .sql file. It was going normal, then suddenly it stopped with a red message “#1273 – Unknown collation: ‘utf8mb4_0900_ai_ci‘”
Like a normal engeeneer, I tried to figure out some info about this strange error. I found many solutions and similar issue like these people were already facing. For few these were resolved and others were still getting it.
This error is occured when importing an SQL file into a database.
# Solution
Edit your SQL file in a code editor (VS Code recommended)
#1253 – COLLATION ‘utf8_unicode_ci’ is not valid for CHARACTER SET ‘utf8mb4’
Find ‘utf8_unicode_ci‘
replace it with
‘utf8mb4_unicode_ci‘
You are done 🙂
1273 – Unknown collation: ‘utf8mb4_unicode_520_ci’
Find ‘utf8mb4_unicode_520_ci‘
replace it with
‘utf8_general_ci‘
You are done 🙂
#1273 – Unknown collation: ‘utf8mb4_0900_ai_ci’
Find ‘utf8mb4_unicode_520_ci‘
replace it with
‘utf8mb4_general_ci‘
You are done 🙂