max_allowed_packet=500Mhtml
[Err] 1153 - Got a packet bigger than 'max_allowed_packet' bytesmysql
修改完记得重启数据库sql
重启数据库:数据库
/etc/init.d/mysql restart性能
查看状态:编码
/etc/init.d/mysql statusspa
1071 - Specified key was too long; max key length is 767 bytesrest
数据库表采用utf8编码,其中varchar(255)的column进行了惟一键索引server
而mysql默认状况下单个列的索引不能超过767位(不一样版本可能存在差别)htm
因而utf8字符编码下,255*3 byte 超过限制
1 使用innodb引擎;
2 启用innodb_large_prefix选项,将约束项扩展至3072byte;
3 从新建立数据库;
my.cnf配置:
default-storage-engine=INNODB
innodb_large_prefix=on
通常状况下不建议使用这么长的索引,对性能有必定影响;
参考文档:
https://dev.mysql.com/doc/refman/5.5/en/innodb-restrictions.html