错误; #1071 - 指定密钥太长;最大密钥长度为1000字节

时间:2016-10-31 05:18:08

标签: php mysql phpmyadmin

我尝试直接从phpMyAdmin导入,并且我一直收到错误响应:

  

错误

     

SQL查询:

     

-    - 表configurations的索引    - ALTER TABLE configurations添加密钥admin_password_2admin_passwordadmin_usernamecaptchacensored_words,   chat),添加密钥comment_character_limit_2(   comment_character_limitemailemail_verificationfriends   ,languagemessage_character_limit),添加密钥reg_req_about_2   (reg_req_aboutreg_req_birthdayreg_req_currentcity,   reg_req_hometownsite_namesite_titlesmooth_links,   story_character_limittheme);

     

MySQL说:文档

     

1071 - 指定密钥太长;最大密钥长度为1000字节

请查看下表

configurations

的表结构
CREATE TABLE IF NOT EXISTS `configurations` (
  `ad_place_hashtag` text NOT NULL,
  `ad_place_home` text NOT NULL,
  `ad_place_messages` text NOT NULL,
  `ad_place_search` text NOT NULL,
  `ad_place_timeline` text NOT NULL,
  `admin_password` varchar(255) NOT NULL DEFAULT 'xxxx',
  `admin_username` varchar(255) NOT NULL DEFAULT 'xxxx',
  `captcha` int(1) NOT NULL DEFAULT '0',
  `censored_words` varchar(255) NOT NULL DEFAULT 'racist,retard',
  `chat` int(1) NOT NULL DEFAULT '0',
  `comment_character_limit` int(10) NOT NULL DEFAULT '0',
  `email` varchar(150) NOT NULL DEFAULT 'no-reply@website.com',
  `email_verification` int(1) NOT NULL DEFAULT '0',
  `friends` int(1) NOT NULL DEFAULT '0',
  `language` varchar(50) NOT NULL DEFAULT 'english',
  `message_character_limit` int(10) NOT NULL DEFAULT '0',
  `reg_req_about` int(1) NOT NULL DEFAULT '0',
  `reg_req_birthday` int(1) NOT NULL DEFAULT '0',
  `reg_req_currentcity` int(1) NOT NULL DEFAULT '0',
  `reg_req_hometown` int(1) NOT NULL DEFAULT '0',
  `reset_time` int(12) NOT NULL,
  `site_name` varchar(150) NOT NULL DEFAULT 'Site Name',
  `site_title` varchar(150) NOT NULL DEFAULT 'Site Title',
  `smooth_links` int(1) NOT NULL DEFAULT '0',
  `story_character_limit` int(10) NOT NULL DEFAULT '0',
  `theme` varchar(100) NOT NULL DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-

- 转储表configurations

的数据
INSERT INTO `configurations` (`ad_place_hashtag`, `ad_place_home`, `ad_place_messages`, `ad_place_search`, `ad_place_timeline`, `admin_password`, `admin_username`, `captcha`, `censored_words`, `chat`, `comment_character_limit`, `email`, `email_verification`, `friends`, `language`, `message_character_limit`, `reg_req_about`, `reg_req_birthday`, `reg_req_currentcity`, `reg_req_hometown`, `reset_time`, `site_name`, `site_title`, `smooth_links`, `story_character_limit`, `theme`) VALUES
('', '', '', '', '', 'xxxx', 'xxxx', 1, 'racist,retard', 0, 0, 'no-reply@website.com', 0, 0, 'english', 0, 0, 0, 0, 0, 0, 'Site Name', 'Site Title', 0, 0, 'lemon');

任何人都可以帮助我吗?我需要绕过这个障碍。

1 个答案:

答案 0 :(得分:0)

对这个问题有一个答案,会发表评论,但没有任何观点。

它只是一个引擎问题,但他有一个索引部分解决方案

Mysql::Error: Specified key was too long; max key length is 1000 bytes