2 Repairing Zabbix database character set and collation
MySQL/MariaDB
As versions before Zabbix 6.0 are not aware of utf8mb4, make sure to first upgrade Zabbix server and DB schema to 6.0.x or later before executing utf8mb4 conversion.
1. Check the database character set and collation.
For example:
Or:
+--------------------------+----------------------+
| @@character_set_database | @@collation_database |
+--------------------------+----------------------+
2. Stop Zabbix.
3. Create a backup copy of the database!
4. Fix the character set and collation on database level:
Fixed values:
mysql> SELECT @@character_set_database, @@collation_database;
+--------------------------+----------------------+
| @@character_set_database | @@collation_database |
+--------------------------+----------------------+
+--------------------------+----------------------+
6. Execute the script:
SET @ZABBIX_DATABASE = '<your DB name>';
If MariaDB → set innodb_strict_mode = OFF;
CALL zbx_convert_utf8();
Please note that ‘utf8mb4’ is expected to consume slightly more disk space.
7. If no errors - you may want to create a database backup copy with the fixed database.
8. Start Zabbix.