Or copy link
If you use MySQL or MariaDB, you might have encountered the following error:
Unknown collation: 'utf8mb4_0900_ai_ci'
This error usually occurs when you try to import a database from a newer MySQL/MariaDB version into an older version. For example:
First, upload your database .sql file via cPanel → File Manager.
.sql
Go to Terminal in cPanel.
Change directory to the folder where the .sql file was uploaded:
cd path/to/your/folder
Replace path/to/your/folder with the actual folder path.
path/to/your/folder
Execute the following command to fix the collation:
sed -e 's/utf8mb4_0900_ai_ci/utf8mb4_unicode_ci/g' -i myfilename.sql
Replace myfilename.sql with your actual SQL file name.
myfilename.sql
This command replaces all instances of utf8mb4_0900_ai_ci with utf8mb4_unicode_ci in the SQL file.
Download the modified SQL file from File Manager and import it again via phpMyAdmin.
Your database will now import successfully without the “Unknown collation: ‘utf8mb4_0900_ai_ci’” error.
cPanel Essential Guide: Master Web Hosting Management w...
Managing your web projects becomes significantly easier...
7 cPanel Settings You Must Change Right Now For 3X Fast...
Save my name, email, and website in this browser for the next time I comment.