1

A WordPress website is created and MySQL is the database for it. When tried to import the database to an empty database via Linux Command Shell we encountered below errors:

ERROR 1146 (42S02): Table 'xx-xxx-xxx-xxx' doesn't exist

ERROR 1273 (HY000): Unknown collation: 'utf8mb4_unicode_ci'

ERROR 1115 (42000): Unknown character set: 'utf8mb4'

What could be the possible cause for these errors? Or should we try an alternative step to restore my WordPress website?

The source database version is mysqlnd 5.0.12 and the destination database is mySQL 5.1.66.

2

When exporting from original database you should choose to create the tables if they dosn't exist (First error). If you didn't choose that option (in phpMyAdmin that option exists, not sure in other database tools), the import file can not create the tables for your and you need to create then prior to start importing it.

For second and third error, you should upgrade your database version to MySQL 5.5.3 or later. Although WordPress can run on MySQL 5.0+, the recommended MySQL version is 5.6 or greater. The problem is that WordPress updates the database to use utf8mb4 if database version is 5.5.3 or later, so probably the source database version was greater than 5.5.3 and the destination database version is lesser than 5.5.3.

If you can not upgrade the destination databser version, edit the import file to change the collation utf8_general_ci and character set to utf8.

Lood for lines similar to:

SET character_set_client  = utf8mb4 ;
SET character_set_results = utf8mb4 ;
SET collation_connection  = utf8mb4_unicode_ci;

and change them.

  • Hi cybmeta, i have edited my question with more detail on database versions. pls check – Zakir HC Mar 8 '16 at 8:45
  • My answer still applies. Your new database (MySQL 5.1.6) don't support utf8mb4. About the old database, mysqlnd is a PHP client library for MySQL, not the version of the old database; not sure if you misstyped it. – cybmeta Mar 8 '16 at 9:47
  • If you can not upgrade the destination database version, you can edit the import file to change database collation and character set to a proper one. Answer edited. – cybmeta Mar 8 '16 at 10:02
1

change all of utf8mb4_unicode_520_ci to utf8mb4_general_ci

  • 1
    This solution worked for us. – Burgi Jul 19 '17 at 11:39
  • This has worked for me in the past as well. – CSSgirl Jan 4 '18 at 18:13
0

Instead Connect the server with mysql workbench application.

Create the new database with all the permissions in place.

Change the collation on created DB by selecting the gear icon on DB to utf8

and then import.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.