ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes
1.缩小索引长度
2.启用系统变量innodb_large_prefix
注意:光有这个系统变量开启是不够的。必须满足下面几个条件:
a: 系统变量innodb_large_prefix为ON:
show VARIABLES like 'innodb_large_prefix';
innodb_large_prefix = 1
b: 系统变量innodb_file_format为Barracuda
show VARIABLES like 'innodb_file_format';
innodb_file_format = Barracuda
c: ROW_FORMAT为dynamic或compressed
这个设置如果版本不支持的话,可以不用配置。
show VARIABLES like '%ROW_FORMAT%';
innodb_default_row_format = dynamic