Issue
- After installing MariaDB 10.6 WordPress site health check reports that
utf8mb4 requires a newer client library
Environment
- CloudLinux OS
- MariaDB 10.6
- Alt-PHP used on the website
Solution
- Switch from CloudLinux
mysqli
PHP module to the PHP nativend_mysqli
module -
Edit the /etc/my.cnf and add the following:
[client]
default-character-set=utf8mb4
[mysql]
default-character-set=utf8mb4
[mysqld]
character-set-server=utf8mb4
character_set_client=utf8mb4
collation-server=utf8mb4_general_ci -
Restart MariaDB server
# service mysqld restart
Cause
- Client library version fetched from MariaDB driver does not meet the minimal version number hardcoded in
wp-admin/includes/class-wp-site-health.php
code - Starting from MariaDB 10.6 the
utf8
character set (and related collations) is now by default alias forutf8mb3
- MariaDB 10.6 support is yet to be implemented
Useful links
Changes and Improvements in MariaDB 10.6 - MariaDB Knowledge Base
Comments
4 comments
In my case, I had to remove "character_set_client" (or "character-set-client") for these instructions to work, because MySQL did not recognize this option. But the other lines did it for me!
You are right. This option may not work on some MySQL versions.
Could you please provide your MySQL version:
# mysql -V
My MySQL version is 8.0.30 for Linux on x86_64.
Since this update change the behaviors of saving "emojis" in the database, please, if you found a solution or if you have want to join the discussion, there is a thread opened at StackOverflow:
https://stackoverflow.com/questions/75809245/cannot-save-emojis-in-utf8mb3-tables-overnight-since-mariadb-10-6-update-and-s
_
I also got some errors and this article should maybe being updated accodingly :
But don't try this:
Which means…
So I cannot wonder if we should switch to "false" and/or using --skip-character-set-client-handshake
If someone walking through here have an idea?
Please sign in to leave a comment.