WordPress 4.2 clean install with utf8
-
Hello everyone.
I have a query if I’m doing right.
The database character set of WordPress 4.2 install is subject to the MySQL version, which means if we install WordPress below mysql 5.5.3, the db charset is utf8 and if above 5.5.3, utf8mb4. This is a nice progress. In Korea, the most shared web hosting services don’t support mysql over 5.5.3 mostly below 5.1. It doesn’t matter if we install WordPress directly in web hosting server, but in case we develop the site in localhost, the db charset is defined as utf8mb4. When I export the database, I can’t import it in the web hosting because of the error. Here are solutions I can think of.
Case 1
If I export it with custom option “Database system or older MySQL server to maximize output compatibility with: MYSQL40”, I can import in web hosting database but the charset is changed to euckr which is Korean basic charset and it works without any errors.
Case 2
If I export the database with utf8mb4 and replace it with utf8 in a text editor, and import it in web hosting, it works well.
Case 3
I installed the WordPress with the core changed only for a while in installing. There is a code which checks the mysql version in the file wp-db.php, line from 3041~3074 in the directory of includes. I changed the mysql version 5.5.3 to 6.0.0 which doesn’t exist yet. After I changed the code and installed the WordPress successfully, I changed the wp-db.php to the original. The db charset is utf8 and the DB_CHARSET of wp-config.php is also utf8 and the collation is utf8_general_ci in db. It works well without any errors.
Case 4
In this case the process is very normal. Install the WordPress in the version 4.1 and upgrade to 4.2 but It takes time.
The case 1 and 2 is for the user who already installed the WordPress 4.2 and the develop is almost done. The 3 and 4 is for the new install. I think the case 3 is best choice. Any feedback is appreciated. Thanks in advance.
- The topic ‘WordPress 4.2 clean install with utf8’ is closed to new replies.