mysql Index column size too large错误解决方案

素颜马尾好姑娘i 2022-05-31 13:22 502阅读 0赞

mysql在执行脚本时,报出了以下错误:

  1. index column size too large. the maximum column size is 767 bytes

解决方案:

  1. 对数据库进行设置

set global innodb_file_format = BARRACUDA;

set global innodb_large_prefix = ON;

如果使用的是云服务器,需要登录到网页管理,然后手动设置参数

2018022612495518

  1. 对脚本进行修改,添加ROW_FORMAT=DYNAMIC

create table test (……..) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

参考文章:

https://stackoverflow.com/questions/30761867/mysql-error-the-maximum-column-size-is-767-bytes

发表评论

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

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

相关阅读