Support » Fixing WordPress » WordPress 4.2 clean install with utf8

  • Resolved martian36

    (@martian36)


    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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The best (and easiest) solution is to make sure that your development environment has the same versions of PHP and MySQL as your production server. Most things I know give you the ability to change the versions when you want to, so I’d try that first as that will ensure that there’s no incompatibilities like this.

    Solution 1 and 2 is probably what you want to go for, but if you have any characters from utf8mb4, they will be messed up.

    But to be true, the real solution is to use MySQL with support for utf8mb4 (MySQL > 5.5.3). If you for any reason have to use an old version of MySQL, you should really disable comments on your site, use Akismet or a 3rd party comment system.

    @catacaustic, @johansen Thanks for the reply.

    This is not only my own problem. I talked with the staffs in web hosting services today and they said they couldn’t upgrade the mysql version. A staff of one of the biggest and popluar services said they already upgraded it to version 5.5.17 and this is very recent and they have no plan to newer version soon. This is the circumstances in Korea. We need a workaround or a second best if there’s no best solution.

    MySQL version 5.5.17 should support the utf8mb4 character set.

    Ref: https://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html

    @johansen Thank you again.

    It is a web hosting service that supports mysql version in maximum since it is biggest service in Korea and in highest price. The most services support very low version and the market share is about 90%. According to this stat, I can say Korean is not ready to use WordPress.


    https://wordpress.org/support/topic/unknown-collation-utf8mb4_unicode_ci

    This is a thread about this topic and I think the WordPress team doesn’t think of the countries like Korea. This is a nation-wide problem with WordPress. I think WordPress market share is going to decrease because of the 4.2 version.

    There is a very good reason for utf8mb4 (security), but you can still do without it if you disable comments or use Akismet (or a 3rd party solution for comments).

    As Otto writes in the thread you are linking to, WordPress is perfectly compatible with MySQL < 5.5.3. But if your development stack doesn’t match your production stack, you can run into all sorts of issues.

    The preferrable thing to do is to get your hosting company to upgrade to a proper MySQL version. If you can’t do that, you have to do your development on their terms, by using software (MySQL) that is compatible – by using MySQL 5.1 locally – or learn how to do database migrations.

    Sorry if I seem a little harsh, but if your hosting sucks and you can’t/won’t move, you have to adapt. Most hosting companies are aware that if their customers can’t use them, they will take their business elsewhere.

    @johansen Thank you.

    I decided not to look for any workaround but to persuade the hosting services to upgrade to newer version. I was going to publish a book and will introduce such sites in it to get more users. I also published a post to promote them. I hope this works.

    Thank you again for the nice and kind reply.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘WordPress 4.2 clean install with utf8’ is closed to new replies.