[ZBXNEXT-5626] Server side: Check DB character set and collation on initial frontend setup page Created: 2019 Dec 05  Updated: 2024 Apr 10  Resolved: 2020 Mar 11

Status: Closed
Project: ZABBIX FEATURE REQUESTS
Component/s: Proxy (P), Server (S)
Affects Version/s: None
Fix Version/s: 4.0.19rc1, 4.4.7rc1, 5.0.0alpha3, 5.0 (plan)

Type: New Feature Request Priority: Trivial
Reporter: Alexander Vladishev Assignee: Zabbix Development Team
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File ZBXNEXT-5626_fixed.patch    
Issue Links:
Causes
causes ZBX-17357 "Unsupported charset or collation for... Closed
Duplicate
Sub-task
part of ZBXNEXT-5603 Check DB character set and collation ... Closed
Team: Team A
Sprint: Sprint 59 (Dec 2019), Sprint 60 (Jan 2020), Sprint 61 (Feb 2020), Sprint 62 (Mar 2020)
Story Points: 1

 Description   

A lot of Zabbix users incorrectly create the DB with default character set and collation settings. This usually works at first but causes problems later.
Server or proxy should log a warning message if these settings are incorrect.



 Comments   
Comment by Martins Abele [ 2020 Feb 14 ]

Available in:

Comment by Roman Pavelka [ 2021 Jun 02 ]

We have run into this and I wonder whether this check is not too strict. The warning in "System information" is

Incorrect default charset for Zabbix database: "utf8mb4" instead "UTF8".

This conversion is even the example of mismatch to be fixed in documention:

https://www.zabbix.com/documentation/current/manual/appendix/install/db_charset_coll

But utf8mb4 shall be superset of MySQL's UTF8 (alias for utf8mb3), with same storage requirements and is broadly recommended as a default charset:

https://www.eversql.com/mysql-utf8-vs-utf8mb4-whats-the-difference-between-utf8-and-utf8mb4/

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

The conversion recommended in the documentation is also potentially problematic. On the other hand, conversion from UTF8 to utf8mb4 should be without any issues at all (see dev.mysql.com link above).

Also:

In MySQL utf8 is currently an alias for utf8mb3 which is deprecated and will be removed in a future MySQL release. At that point utf8 will become a reference to utf8mb4.

So regardless of this alias, you can consciously set yourself an utf8mb4 encoding.

From: https://stackoverflow.com/a/52337457/12118546

Maybe this would be reason to reopen this or start a new issue?

CC @sasha, @mabele

Comment by Andris Mednis [ 2021 Jun 02 ]

Today Zabbix works with UTF-8 up to 3-byte characters. I think supporting up to 4-byte characters will require some modifications.

Comment by Roman Pavelka [ 2021 Jun 02 ]

Thank you for prompt reply, Andris. I see that there are possible problems so we should do the change to utf8.

Seeing that utf8mb3 support will be removed in MySQL, I voted for ZBXNEXT-3706 and its duplicate ZBXNEXT-3238. Searching JIRA for emoji and utf8mb4, you can see more issues, so it is possible there are more of these duplicates.

Comment by Andris Mednis [ 2021 Jun 02 ]

Thanks, Roman Pavelka, for pointing to related ZBXNEXT's

Generated at Thu Apr 24 06:23:33 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.