导数据遇到的ERROR 1071 (42000): Specified key was too long问题
来源:互联网 发布:淘宝助理下载与安装 编辑:程序博客网 时间:2024/05/23 16:33
今天在导数据到新搭建的测试环境中遇到了下面的错误提示:
ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes
应该是键的长度超过了阈值,首先是想到了字符集设置的问题,在将测试环境与线上环境的字符集设置成一致后,依然是这个错误,查看表的定义
CREATE TABLE `__Auth` ( `user` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, PRIMARY KEY (`user`), KEY `user` (`user`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED;
user字段确实较大255*3接近了767,通过对比2个实例的参数,发现了一个参数innodb_large_prefix,线上设置了这个参数为on,允许键的长度超出限制。测试环境设置后,正常导入
innodb_large_prefix
Introduced 5.6.3
Command-Line Format –innodb_large_prefix
System Variable Name innodb_large_prefix
Variable Scope Global
Dynamic Variable Yes
Permitted Values Type boolean
Default OFF
Enable this option to allow index key prefixes longer than 767 bytes (up to 3072 bytes) for InnoDB tables that use the DYNAMIC and COMPRESSED row formats. (Creating such tables also requires the option values innodb_file_format=barracuda and innodb_file_per_table=true.) See Section 14.8.8, “Limits on InnoDB Tables” for the relevant maximums associated with index key prefixes under various settings.
For tables using the REDUNDANT and COMPACT row formats, this option does not affect the allowed key prefix length.
- 导数据遇到的ERROR 1071 (42000): Specified key was too long问题
- MySQL: ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes
- MySQL: ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes
- MySQL: ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes
- ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes
- ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes
- MySQL: ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes
- MySQL: ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes
- ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes
- MySQL中ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes错误的处理
- Laravel5.5问题:SQLSTATE[42000] Syntax error or access violation 1071 Specified key was too long; max k
- Specified key was too long
- Laravel migrate时报错: Syntax error or access violation: 1071 Specified key was too long
- mysql [42000][1071] Specified key was too long; max key length is 767 bytes
- laravel Specified key was too long 解决方案
- Specified key was too long; max key length is 767 bytes问题
- hive执行命令Specified key was too long; max key length is 767 bytes 问题
- 关于MySQL字符集问题:Specified key was too long; max key length is 767 bytes
- android -- 关于fragment
- angularjs学习笔记--ng-class的三种使用方法
- 在阿里云 CentOS 服务器(ECS)上搭建 nginx + mysql + php-fpm 环境
- mac下直接用brew安装的问题
- 49.Android过渡动画的一个小练习
- 导数据遇到的ERROR 1071 (42000): Specified key was too long问题
- FacebFacebook 处理自动登录问题(iOS)
- 一步步教你学Weex Android加载远程服务器配置
- CentOS下yum安装php-memcached
- 深入 Java 内存模型(2)
- 顺序队列模板--c++实现
- 兄弟郊游问题
- Solr6.2.1集群搭建
- 预定义函数对象