If you face the “Error 1273 (Hy000) At Line 25 Unknown Collation: ‘Utf8mb4_0900_Ai_Ci’”, we will research, and propose typical solutions to this error, and help you overcome it easily and effectively in the future.
How does the “error 1273 (Hy000) At Line 25 Unknown Collation: ‘Utf8mb4_0900_Ai_Ci’” happen?
As usual, this error particularly happens due to older versions of MYSQL, especially for importing the My database.
In this case, you are putting more effort into importing My database, and the error 1273 appears below
Error 1273 (HY000) at line 25 Unknown collation: 'utf8mb4_0900_ai_ci'
From this error above, we come up with root causes such as
1. A lot of older versions in MYSQL
You forget to update the newer versions of MYSQL.
2. The big differences between versions of MYSQL
It is caused by the live and local servers operating with various versions of MYSQL.
How to fix “Error 1273 (Hy000) At Line 25 Unknown Collation: ‘Utf8mb4_0900_Ai_Ci’”?
Approach 1: Use CHARSET
To tackle this error, you first use the “CHARSET”. Remember to get a backup of your SQL file, and attempt to change it. Let’s open your SQL file with this error, and look for the error line in this file below.
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
Afterward, you have to substitute the above line with the new line below.
ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
Finally, save the SQL file and attempt to import this file again. Until then, we make sure that your error can be tackled entirely.
Approach 2: Find “utf8mb4_” and replace “utf8_”
- First of all, you open your SQL file in the text editor. Next, find and replace “utf8mb4_unicode_ci” with “utf8_general_ci”.
- Secondly, find and replace “utf8mb4_unicode_520_ci” with “utf8_general_ci”.
- Lastly, do the same thing with “utf8mb4” and replace it with “utf8”. Then, try to import the SQL file again and check the error.
After doing all steps above, the error 1273 disappears when you access your database.
Approach 3: Upgrade MySQL or MariaDB to a newer version
The final solution is to upgrade MariaDB or MySQL to a higher version. After updating to the newer version, and running your program; this error will be solved successfully.
We make sure that you can find it useful to deal with the “Error 1273 (HY000) at line 25 Unknown collation: ‘utf8mb4_0900_ai_ci’”. Finally, bear in mind to reply to us if possible. Thanks!
→ Tips On Solving The Error: “SQLSTATE[HY000]: General error: 1835 Malformed communication packet on LARAVEL”
Leave a comment