Ad Widget

Collapse

New Zabbix installation, "Specified key was too long" error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bolverk
    Junior Member
    • Apr 2018
    • 2

    #1

    New Zabbix installation, "Specified key was too long" error

    I'm sorry for possibly stupid question.
    I have fresly installed server with Debian 9.4 on it. Zabbix server and agent installs with no problem, agent starts and is working. I'm following this installation manual:

    I created dtabasse, but when I'm trying ti initialise it with command:
    # zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -uzabbix -p zabbix I get error:

    ERROR 1071 (42000) at line 162: Specified key was too long; max key length is 767 bytes

    MariaDB server version is:
    Server version: 10.1.26-MariaDB-0+deb9u1 Debian 9.1

    What am I doing wrong? How can I manage to get Zabbix running with my configuration?
    Thanks in advance.
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    Is the character set of the database set to utf8mb4?
    At the moment, please use utf8.

    ex.
    Code:
    create database zabbix character set utf8 collate utf8_bin;

    Comment

    • Bolverk
      Junior Member
      • Apr 2018
      • 2

      #3
      Thanks, man, You're the best! It worked. I couldn't find solution for this and I haven't had any problems with simple "create database" until now. Case closed.

      Comment

      • cuongvu1992
        Junior Member
        • May 2021
        • 3

        #4
        Originally posted by Atsushi
        Is the character set of the database set to utf8mb4?
        At the moment, please use utf8.

        ex.
        Code:
        create database zabbix character set utf8 collate utf8_bin;
        thank man, you save my time

        Comment

        • salai
          Junior Member
          • Nov 2020
          • 27

          #5
          I am getting the error even though I have utf8 chat set, What could be the reason for my case?

          mysql> SELECT @@character_set_database;
          +--------------------------+
          | @@character_set_database |
          +--------------------------+
          | utf8 |
          +--------------------------+
          1 row in set (0.00 sec)

          Comment

          Working...