[ZBX-21301] Error message cannot set MySQL character to "utf8" Created: 2022 Jul 05  Updated: 2024 Apr 10  Resolved: 2022 Jul 20

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Proxy (P), Server (S)
Affects Version/s: 5.0.25
Fix Version/s: 5.0.26rc1, 6.0.7rc1, 6.2.1rc1, 6.4.0alpha1, 6.4 (plan)

Type: Problem report Priority: Major
Reporter: Vladimir Stepanov (Inactive) Assignee: Vladislavs Sokurenko
Resolution: Fixed Votes: 1
Labels: MariaDB, charset, collate
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: JPEG File 2022-08-16_08-59-56.jpg     PNG File CHARACTER_SET.PNG     File ZBX-21301-5.0-test.diff     PNG File image-2022-08-16-09-01-20-306.png     PNG File image-2022-08-18-15-57-42-644.png     PNG File image-2022-08-18-15-58-47-579.png     PNG File image-2022-08-18-16-00-58-202.png     Text File zabbix_server.log    
Issue Links:
Causes
causes ZBX-21385 utf8mb3 error message in zabbix serve... Closed
Duplicate
Sub-task
part of ZBXNEXT-7694 Incorrect charset for MySQL database ... Closed
Team: Team A
Sprint: Sprint 90 (Jul 2022)
Story Points: 0.25

 Description   

The Zabbix server generates the error in zabbix_server.log:

cannot set MySQL character to "utf8" 

OS: Centos 7

DB: mysql Ver 15.1 Distrib 10.6.8-MariaDB,

Zabbix version: 5.0.21, 5.0.25

See attached log filezabbix_server.log



 Comments   
Comment by Vladislavs Sokurenko [ 2022 Jul 05 ]

Please show output of:

SHOW CHARACTER SET;
Comment by Vladislavs Sokurenko [ 2022 Jul 05 ]

Please try ZBX-21301-5.0-test.diff , we need to detect that there is only utf8mb3 and use utf8mb3 then, unfortunately currently we will use utf8 in that case which is not correct.

Comment by Vladislavs Sokurenko [ 2022 Jul 05 ]

Looks like database does not support utf8 and only utf8mb3 or utf8mb4 can be used, 6.0 should work fine with ut8mb4 until 5.0 is fixed to detect that utf8 is missing.

Comment by Vladislavs Sokurenko [ 2022 Jul 12 ]

Fixed in:

Comment by Pavel [ 2022 Aug 16 ]

Fixed one and broke the other

after the update, the Russian language stopped working, and in the server log there is an error:
cannot set MySQL character set to "utf8mb3"

 

Comment by Daniel Heise [ 2022 Aug 18 ]

We have the same problem with the german language after upgrading from 6.0.6 to 6.0.7:

 

 

database language is utf8

 

sending umlauts with zabbix_sender results in:

 

Comment by Daniel Heise [ 2022 Aug 19 ]

Today we switched the database characterset from utf8 to utf8mb4. The problem is gone.

We used this guide: https://www.zabbix.com/documentation/current/en/manual/appendix/install/db_charset_coll

 

 

Comment by Pavel [ 2022 Aug 19 ]

the solution is relevant only for version 6, zabbix 5 does not work with this encoding

Comment by Vladislavs Sokurenko [ 2022 Aug 19 ]

Unfortunately it does not work on some distributions as documented in MySQL documentation which states:

Historically, MySQL has used utf8 as an alias for utf8mb3; beginning with MySQL 8.0.28, utf8mb3 is used exclusively in the output of SHOW statements and in Information Schema tables when this character set is meant.

Source:
https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-utf8mb3.html

Also some installations might even be missing utf8, however documented as supported characters sets here:
https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-sets.html

If using 6.0 or higher it is suggested to upgrade to utf8mb4 as utf8mb3 is being deprecated and current alias is utf8 for utf8mb3, however 5.0 cannot use utf8mb4.

Improved detection in ZBX-21385.

Generated at Mon Jun 30 08:44:17 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.