zabbix升级3.2.1报错mysql1071


今天把zabbix升级到官网最新版,升级过程中遇到问题。

26362:20161103:103712.497 completed 48% of database upgrade
26362:20161103:103712.497 [Z3005] query failed: [1071] Specified key was too long; max key length is 1000 bytes [create index problem_tag_2 on problem_tag (tag,value)]
26362:20161103:103712.498 database upgrade failed

在官网查了一下只有mysql引擎为myisam而innodb引擎不会出现此问题,没办法,也不能去改升级脚本避免索引长度超过1000,只能把mysql引擎修改为innodb,于是乎修改mysql配置文件:

vim /etc/my.cnf

default-storage-engine=INNODB
innodb_large_prefix=on
innodb_file_format=Barracuda

添加以上参数重启mysql服务就好了。

qq%e6%88%aa%e5%9b%be20161104143203


Whatever is worth doing is worth doing well.