Percona and utf8mb4

Greetings

When I ran into a problem when I use Percona 8 and utf8mb4 character_set option, my code doesn’t work with full utf8mb4 support. But the same code and database setup works fine on MariaDB

The only difference between the two servers
character_set_system | utf8 - MariaDB
character_set_system | utf8mb3 - Percona

I think the default charset for MariaDB utf8 is utf8mb4
Is it possible and safe to update character_set_system for Percona from utf8mb3 to utf8mb4

Yes, and using utf8mb4 is preferred. utf8mb3 will be removed soon.

Unfortunately, there is no option in my.cnf

[ERROR] [MY-000067] [Server] unknown variable ‘character-set-system=utf8mb4’

https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_character_set_system

character-set-system

  • The character set used by the server for storing identifiers. The value is always utf8mb3.

I would ignore this then, since you cannot change it. Additionally, this is not the parameter you need to change. You need to set character_set_server = utf8mb4 as this is the default character set.

https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_character_set_server

It should be noted that the default character set for Percona Server MySQL 8.0 is also utf8mb4. Use your application code to inspect the connection itself and verify the connection is established using utf8mb4.