This error is caused by the difference in encoding types between the source and destination database. The newer SQL database may use uft8mb4, and the older version may use utf8. This process of importing may cause this error. The 520 refers to MYSQL’s Unicode Collation Algorithm 5.2.0. This error may also happen when if you are trying to import MariaDB into MYSQL.
To fix :
Search and replace database dump file:
Step 1: Open the SQL file in your text editor;
Step 2: Search for: utf8mb4_unicode_ci Replace:uft8_general_ci(Replace All)
Step 3: Search for: utf8mb4_unicode_520_ci Replace:uft8_general_ci(Replace All)
Step 4: Search for: utf8mb4 Replace: uft8(Replace All)
Step 5: Save and upload.
In the case of using phpMyAdmin. Format specification while exporting the database method:
1. From phpMyAdmin, login to the database and just ensure it is the database requirement.
2. Select the export option from the database and choose "custom."
3. Locate the option Database system or older MySQL server to maximize output compatibility with "MYSQL40".
4. Click on go.
Note: This resolves the unknown collation error. This is very simple one.
Step 1: This is same as text editor method but we do it in a .sql file
Step 2: ENGINE-Inne0DB DEFAULT CHARSET=uft8mb4 COLLATE=utf8mb4_unicode_520_ci;
Step 3: In your .sql file, and swapping it with
Step 4: ENGINE-Inne0DB DEFAULT CHARSET=uft8 COLLATE=utf8_general_ci;