MySQL Restore Error: Unknown collation: 'utf8mb4_unicode_520_ci'

Unknown collation: 'utf8mb4_unicode_520_ci'

This error will occur if we are attempting to restore database dump from Mysql 5.5.3+ to older versions. utf8mb4 is a more sophisticated encoding type for varchar columns which is used in latest Mysql versions.

In-order to fix this issue, we need to replace all occurrence of the below line in the dump file,

ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;

with the following,

ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

Now we will be able to restore the dump file without any issues.

Leave a Reply

Your email address will not be published. Required fields are marked *