Specified key was too long; max key length is 1000 bytes(指定的键太长;最大密钥长度为 1000 字节)
问题描述
通过 mySQL 转储导入 Joomla 1.5 数据库,但出现错误1071 - 指定的密钥太长;最大密钥长度为 1000 字节"
importimg Joomla 1.5 database via mySQL dump but it gives error "1071 - Specified key was too long; max key length is 1000 bytes"
罪魁祸首的sql语句是:
the culrpit sql statement is:
CREATE TABLE `jos_core_acl_aro` (
`id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
`section_value` VARCHAR( 240 ) NOT NULL DEFAULT '0',
`value` VARCHAR( 240 ) NOT NULL ,
`order_value` INT( 11 ) NOT NULL DEFAULT '0',
`name` VARCHAR( 255 ) NOT NULL ,
`hidden` INT( 11 ) NOT NULL DEFAULT '0',
PRIMARY KEY ( `id` ) ,
UNIQUE KEY ( `section_value` , `value` ) ,
KEY `jos_gacl_hidden_aro` ( `hidden` )
) ENGINE = MYISAM DEFAULT CHARSET = utf8 AUTO_INCREMENT =11;
MySQL said:
#1071 - Specified key was too long; max key length is 1000 bytes
来源&目标数据库是UTF8.我仍然不知道为什么会出现这个错误:(
The source & destination database is UTF8. I still don't know why this error occurs :(
推荐答案
mysql 将 utf8 编码的字符存储为 3 个字节
mysql stores utf8 encoded chars as 3 bytes
你的钥匙
UNIQUE KEY ( `section_value` , `value` ) ,
大小为 (240 + 240) * 3 个字节,大于 1000 个限制
has a size of (240 + 240) * 3 bytes, which is greater then 1000 limit
这篇关于指定的键太长;最大密钥长度为 1000 字节的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:指定的键太长;最大密钥长度为 1000 字节
基础教程推荐
- 在 MySQL 中:如何将表名作为存储过程和/或函数参数传递? 2021-01-01
- mysql选择动态行值作为列名,另一列作为值 2021-01-01
- 二进制文件到 SQL 数据库 Apache Camel 2021-01-01
- 如何根据该 XML 中的值更新 SQL 中的 XML 2021-01-01
- 在多列上分布任意行 2021-01-01
- MySQL 中的类型:BigInt(20) 与 Int(20) 2021-01-01
- 如何在 SQL 中将 Float 转换为 Varchar 2021-01-01
- 什么是 orradiag_<user>文件夹? 2022-01-01
- 表 './mysql/proc' 被标记为崩溃,应该修复 2022-01-01
- oracle区分大小写的原因? 2021-01-01
