Home>

Since wordpress 4.2,If the data encoding we exported in the mysql5.1 version of the data is with utf8mb4 format, if we relocate the site to restore the data,"Unknown collation:" utf8mb4_unicode_ci "error occurs when importing a database of higher version such as mysql5.5 into a lower version of mysql5.1.There was no such problem before.Only available from wp4.2.

To solve this problem,If we use vps/server, we can upgrade the mysql database version similar to yesterday's "The process of upgrading mysql5.1 to mysql5.5 under linux centos6 environment"There will be no incompatibility issues,But if we use a virtual host or upgrade mysql with certain technical activities,If the error is really troublesome.Here we can choose a compatible version when exporting the database.

First, backup data

Before we upgrade and import the data,You need to back up the website data from the existing host/server.

Second, export a compatible version database

Enter phpmyadmin and see the following interface when we export the database.

Solve wordpress import database "unknown collation:" utf8mb4_unicode_ci "error

Since wordpress 4.2,If the data encoding we exported in the mysql5.1 version of the data is with utf8mb4 format, if we relocate the site to restore the data,"Unknown collation:" utf8mb4_unicode_ci "error occurs when importing a database of higher version such as mysql5.5 into a lower version of mysql5.1.There was no such problem before.Only available from wp4.2.

To solve this problem,If we use vps/server, we can upgrade the mysql database version similar to yesterday's "The process of upgrading mysql5.1 to mysql5.5 under linux centos6 environment"There will be no incompatibility issues,But if we use a virtual host or upgrade mysql with certain technical activities,If the error is really troublesome.Here we can choose a compatible version when exporting the database.

First, backup data

Before we upgrade and import the data,You need to back up the website data from the existing host/server.

Second, export a compatible version database

Enter phpmyadmin and see the following interface when we export the database.

Select a custom export method.

Looking at the figure above, select mysql40 in the most compatible database option, and then export the database and import it into the lower version of mysql without any problems.If there are garbled characters,We will:

define ("db_charset", "utf8mb4");

Change to

define ("db_charset", "utf-8");

Because utf8mb4 needs to be compatible with versions 5.5 and above,If we are newly installing vps website environment,It is recommended to directly install/upgrade MySQL to 5.5 and above.This will not cause such problems.

  • Previous Realize the progress bar display effect based on jQuery Bar Indicator plugin
  • Next PHP remove backslash \ from json string and remove backslash before double quotes