ITPub博客

首页 > 数据库 > MySQL > 1709 - Index column size too large. The maximum column size is 767 bytes.

1709 - Index column size too large. The maximum column size is 767 bytes.

原创 MySQL 作者:mcxiaoracle 时间:2022-11-11 23:55:44 0 删除 编辑

说明  注:以 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/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: 数据调度
请登录后发表评论 登录
全部评论
数据方向,了解oracle ,IBM DB2 730

注册时间:2019-09-30

  • 博文量
    286
  • 访问量
    226627