mysql 5.5.62版本建表语句报错: Index column size too large. The maximum column size is 767 bytes

桃扇骨 2024-03-22 13:55 145阅读 0赞

问题

执行建表语句时,报错

  1. Index column size too large. The maximum column size is 767 bytes

抽丝剥茧

网上查了很多办法,其中一个办法是,执行如下两句话:

  1. set global innodb_large_prefix=ON;//开启不限制索引长度
  2. set global innodb_file_format=BARRACUDA;

执行之后,发现不可行。

原因是因为:我的mysql版本比较低,是5.5.62版本的

最终解决方案

应该是执行三句:

  1. set global innodb_large_prefix='on';
  2. set global innodb_file_format='Barracuda';
  3. set global innodb_file_per_table ='on'

特别提醒:建表语句最后要加上 ROW_FORMAT=DYNAMIC

发表评论

表情:
评论列表 (有 0 条评论,145人围观)

还没有评论,来说两句吧...

相关阅读