ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes
来源:互联网 发布:c语言strncpy 编辑:程序博客网 时间:2024/06/05 13:48
ElasicSearch关联的mysql表,插入数据时会有以下提示
ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes
原因分析:
MySQL的varchar主键只支持不超过767个字节,需要将mysql的字符编码设置为utf8mb4
输入以下命令打开编辑界面
sudo vi /etc/mysql/my.cnf
在[mysqld]下加入以下配置:
innodb_file_format=barracuda innodb_file_per_table=true innodb_large_prefix=true character-set-server=utf8mb4 collation-server=utf8mb4_unicode_ci max_allowed_packet=500M保存完重启后就能插入了。
详细可见Nutch之MySQL数据库的配置
0 0
- 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 [42000][1071] 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 [Err] 1071 - Specified key was too long; max key length is 767 bytes
- 1071-specified-key-was-too-long-max-key-length-is-767-bytes
- ERROR 1071 (42000) at line 142: Specifiedkey was too long; max key length is 767 bytes
- Specified key was too long; max key length is 767 bytes
- hive的Specified key was too long; max key length is 767 bytes问题解决
- Specified key was too long; max key length is 767 bytes问题
- MySQL:Specified key was too long; max key length is 767 bytes
- Specified key was too long; max key length is 767 bytes
- 【数据库】——Navicat Premium快捷操作
- HDOJ 5832 a water problem(大数取模)
- 神经网络ANN
- jQuery表单过滤选择器
- hihocoder 1358 小P的强力值
- ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes
- JDK线程池使用小结
- NOIPの模拟_2016_8_14_t1_传送带
- 2554. 【NOIP2011模拟9.7】帕秋莉·诺蕾姬 (Standard IO)
- 一些想法
- 一句话证明你懂那些char
- ServletContext,ActionContext和ServletActionContext比较
- C++ hdoj 2035 (人见人爱A^B)
- hdu 5839 Special Tetrahedron