- Home
- MySQL & MariaDB
- Relational Databases
- Migrating to MySQL 8.0 for WordPress – episode 1
Migrating to MySQL 8.0 for WordPress – episode 1
Feed: Planet MySQL
;
Author: Frederic Descamps
;
Yesterday I decided to upgrade the database server of lefred.be running the latest WordPress to MySQL 8.0.
The previous version was 5.7.19.
My dedicated server is still running on CentOS 6.x, and I had just to enable the MySQL Community 8.0 yum repository and upgrade the rpms:
# yum update mysql-community-server --enablerepo=mysql80-community
After the upgrade, I had to modify my.cnf to remove the lines related to the non regretted Query Cache:
#query_cache_type=0 #query_cache_size=0
After this, I could start mysqld
and run mysql_upgrade
.
I tried to connect with the command line client and it worked perfectly.
Then, I wanted to remove the maintenance mode on lefred.be but WordPress returned me an error that it couldn’t connect to the database:
I verified the mysql error log, nothing wrong (bad credentials are logged), and no error in the apache’s log.
I decided to run WordPress in debug mode :
in wp-config.php
set
define('WP_DEBUG', false)
Then I could see this error message that sounded familiar:
Warning: mysqli_real_connect(): Server sent charset (255) unknown to the client. Please, report to the developers in /var/…/www/wp-includes/wp-db.php on line 1548
I modified again my.cnf
to add the following line under [mysqld]
:
collation-server = utf8mb4_general_ci
After a restart of mysqld, everything went back normal !
The MySQL connector used on my system for PHP is php55w-mysqlnd-5.5.38-1.w6.x86_64
:
Name : php55w-mysqlnd Arch : x86_64 Version : 5.5.38 Release : 1.w6 Size : 956 k Repo : installed From repo : webtatic Summary : A module for PHP applications that use MySQL databases URL : http://www.php.net/ License : PHP Description : The php-mysqlnd package contains a dynamic shared object that will add : MySQL database support to PHP. MySQL is an object-relational database : management system. PHP is an HTML-embeddable scripting language. If : you need MySQL support for PHP applications, you will need to install : this package and the php package. : : This package use the MySQL Native Driver
The next post will be related to the workload analysis using performance_schema & sys and see if something can be improved.
Related
Leave a Reply
You must be logged in to post a comment.