Author Topic: zabbix error 1071 (42000) at line 162: Specified key was too long; max key 767  (Read 1277 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2035
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
zabbix error 1071 (42000) at line 162: Specified key was too long; max key 767
« on: พฤษภาคม 17, 2019, 09:39:53 PM »
# 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

fixed by recreate database with utf8

mysql -u root -p
mysql> DROP DATABASE IF EXISTS zabbixdb;
mysql>CREATE DATABASE zabbixdb DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
mysql> GRANT ALL on zabbixdb.* to zabbix@localhost IDENTIFIED BY ‘password’;
mysql> FLUSH PRIVILEGES;

cd /usr/share/doc/zabbix-server-mysql
zcat create.sql.gz | mysql -u zabbix -p zabbixdb

 ;)