mysql在执行脚本时,报出了以下错误:
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;
如果使用的是云服务器,需要登录到网页管理,然后手动设置参数
2. 对脚本进行修改,添加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