Zabbix server upgrade from 3.4.9 to 6.0.18 failed on MySQL 8.0.33 due to utf8mb4 character set

XMLWordPrintable

    • Type: Problem report
    • Resolution: Commercial support required
    • Priority: Trivial
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      Hi,

      We have same issue. After Zabbix upgrade from 3.4.9 to 6.0.18 database conversion failed with below error,

          [Z3005] query failed: [1071] Specified key was too long; max key length is 3072 bytes [alter table `items` modify `key_` varchar(2048) default '' not null].

      We have default database schema is latin1_swedish_ci. We have directly upgraded Zabbix from 3.4.9 to 6.0.18 without any issue.  After Zabbix upgrade tried to execute utf8mb4 conversion but table conversion failed with above error,   

         [Z3005] query failed: [1071] Specified key was too long; max key length is 3072 bytes [alter table `items` modify `key_` varchar(2048) default '' not null]. 

       

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

      Executed below command and then ran the database migration again. Database migration completed without any issue.  

      ALTER TABLE zabbix.items MODIFY COLUMN key_ VARCHAR(764) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin not null default ' ';

       

      Query is modifying table `items` modify `key_` varchar(2048) to key_ VARCHAR(764) will cause any issue to Zabbix database? Any help appreciated. 

       

       Mysql version  8.0.33
      zabbix version 6.0.18
      Edit Delete

            Assignee:
            Zabbix Support Team
            Reporter:
            Venky
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: