:Innodb表的行记录格式是Dynamic或Compressed的前提下,单列索引长度上限扩展到3072个字节。
:Innodb表的单例索引长度最多为767个字节,索引长度超出后,主键索引会创建失败,辅助索引会被截断成为前缀索引。
设置MySQL的全局参数innodb_large_prefix=ON,将InnoDB表的索引长度上限扩大到3072个字节。
show variables like 'innodb_large_prefix'; show variables like 'innodb_file_format';
2.修改配置
set global innodb_large_prefix=ON;//开启不限制索引长度 set global innodb_file_format=BARRACUDA;//这个不知道
3、修改表
ALTER TABLE `TableName ` row_format=dynamic;
联系客服