Specified key was too long; max key length is 767 bytes [Failed SQL: (1071)
时间: 2023-08-19 22:12:27 浏览: 128
这个错误是由于索引字段的长度超过了MySQL的限制导致的。根据引用\[1\]和引用\[2\],这个错误在各个版本的MySQL中都已经解决了。解决方法是将索引字段的长度缩短,使其不超过767字节。另外,根据引用\[3\],如果你的MySQL配置中设置了innodb_large_prefix=1并且innodb_file_format=BARRACUDA,对于row_format为dynamic的表,可以指定索引列长度大于767字节。但是总的索引列长度仍然不能超过3072字节的限制。所以,你可以尝试调整索引字段的长度,或者根据你的MySQL配置进行相应的调整来解决这个问题。
#### 引用[.reference_title]
- *1* [【数据库】[Err] 1071 - Specified key was too long; max key length is 767 bytes](https://blog.csdn.net/weixin_53791978/article/details/128857775)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [1071 - Specified key was too long; max key length is 767 bytes](https://blog.csdn.net/qq_38925911/article/details/118210392)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文