error Error: ER_TOO_LONG_KEY: Specified key was too long; max key length is 767 bytes at Query.Sequence._packetToError

存在的问题:

Mysql的字段设bai置的太长。

建立索引时,数据库计算zhikey的长度是累加所dao有Index用到的字zhuan段的char长度;再按下面shu比例相乘不能超过限定的key长度1000:
  latin1=1 byte=1 character;
  uft8=3 byte=1 character;
  gbk=2 byte=1 character。

解决方法:

修改字段长度;

修改mysql默认的存储引擎( 将其设置为 utf8 字符集 )

原文地址:https://www.cnblogs.com/gqx-html/p/14467898.html