说明
注:以 utf8mb4 字符集
字符串
类型字段为例。utf8mb4 是 4 字节字符集,默认支持的索引字段最大长度是 191 字符(767 字节 / 4 字节每字符 ≈ 191 字符),因此在
varchar(255)
或
char(255)
类型字段上创建索引会失败。
set global innodb_large_prefix = 1;
set global innodb_file_per_table = 1;
set global innodb_file_format = Barracuda;
ROW_FORMAT = DYNAMIC
参考博文:
https://blog.csdn.net/kjrim/article/details/115141343
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69949806/viewspace-2923034/ ,如需转载,请注明出处,否则将追究法律责任。