Using innodb_large_prefix to avoid ERROR 1071 单列索引限制上面有提到单列索引限制767,起因是256×3-1.这个3是字符最大占用空间(utf8).但是在5.5以后,开始支持4个字节的uutf8.255×4>767, 于是增加了一个参数叫做 innodb_large_prefix.这个参数默认值是OFF.当改为ON时,允许列索引最大达到3072. 联合索引3072我们知道InnoDB一个page的默认大小是16k.由于是Bt…
今天在MySQL 5.6版本的数据库中修改InnoDB表字段长度时遇到了"ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes"错误,第一次遇到这个错误,遂花了点学习.研究过.总结这个问题. 我们先来创建一个测试表,构造这样的错误. mysql> use MyDB; Reading table information for completion of table and colum…
1.发现问题 今天在修改innodb表的某个列的长度时,报如下错误: alter table test2 modify column id varchar(500); ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes alter table test2 modify column id varchar(500); ERROR 1071 (42000): Specified key was too…
在使用utf8mb4字符集的情况下,如果列存在索引,那么varchar的最大长度是191 数据库版本: 在使用utf8字符集的情况下,如果列存在索引,那么varchar的最大长度是255. 在大字段上创建索引时,有时会碰到下面的错误 ERROR 1709 (HY000): Index column size too large. The maximum column size is 767 bytes. 1. 错误原因 由于 MySQL Innodb 引擎表索引字段长度的限制为 767 字节,因…
官方的解释: The error happens because MySQL can index only the first N chars of a BLOB or TEXT column. So The error mainly happen when there is a field/column type of TEXT or BLOB or those belongs to TEXT or BLOB types such as TINYBLOB, MEDIUMBLOB, LONGBL…
操作重现: 法1:新建连接——>新建数据库——>右键数据库导入脚本——>提示:Specified key was too long; max key length is 767 bytes 法2:新建连接——>新建数据库——>新增查询——>复制脚本中的内容,运行——>提示:Specified key was too long; max key length is 767 bytes 原因: MySQL的varchar主键只支持不超过768个字节 或者 768/2=…
Specified key was too long; max key length is 767 bytes 说明: 执行当前 Web 请求期间,出现未经处理的异常.请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息. 异常详细信息: MySql.Data.MySqlClient.MySqlException: Specified key was too long; max key length is 767 bytes 给Context增加如下的注解 [DbConfigu…
写在前面 在项目中,有客户反应无法正常加载组织结构树,弄了一个测试的程序,在日志中查看到如下信息: Error in deserializing body of reply message for operation 'GetDepartMentList'. The maximum array length quota (16384) has been exceeded while reading XML data. This quota may be increased by changing…