今天在做Mysql 索引添加时,报了个Index column size too large. The maximum column size is 767 bytes.错误。因为我的mysql版本是5.6的。所以。在此做下记录。
首先 。可以查看使用命令查看相关信息是否启用。
1.SHOW variables like ‘innodb_large_prefix’ (Value是ON)
否则则设为:set global innodb_large_prefix = ON
2.SHOW variables like ‘innodb_file_format’ (Value是Barracuda)
否则则设为:set global innodb_file_format = BARRACUDA
再次可以执行。如果继续报错,则需要继续执行以下方式,
alter table xxx row_format=dynamic;
alter table xxx row_format=compressed;
再次执行sql.设置索引。
如果还是报错。则需要修改字段的长度了。
Index column size too large. The maximum column size is 767 bytes.
最新推荐文章于 2024-06-05 14:32:55 发布