Your database does not support utf8mb4

Hi,

I have updated to Matomo 4.0.5.
The update, including the database updates, went fine, but when attempting to convert the DB to use utf8mb4, by running console core:convert-to-utf8mb4, I just get a “Your database does not support utf8mb4” message.

Looking at the script, it seems this has to do with utf8mb4 not being the default character set of our MySQL db - version 5.5.29, on RHEL.

I have tried setting the following parameters in my.cnf manually (and restarted), but without luck:

[client]
default-character-set=utf8mb4
[mysql]
default-character-set=utf8mb4
[mysqld]
character-set-server = utf8mb

Is there anything else I should have a look at, or is this an issue with our (old) version of MySQL?
Many thanks for any suggestions!

Hi,

https://mathiasbynens.be/notes/mysql-utf8mb4
claims that MySQL 5.5.3 is the first version supporting utf8mb4.

But of course it might be possible that whoever compiled your binary disable the feature at compile time.

Thanks!

It seems that adding the following settings in my.cnf solved the issue:

[client]
default-character-set = utf8mb4

[mysql]
default-character-set = utf8mb4

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci