php - 错误; #1071 - 指定的 key 太长;最大 key 长度为 1000 字节

标签 php mysql phpmyadmin

我尝试直接从 phpMyAdmin 导入,但不断收到如下错误响应:

Error

SQL query:

-- -- Indexes for table configurations -- ALTER TABLE configurations ADD KEY admin_password_2 ( admin_password , admin_username , captcha , censored_words , chat ) , ADD KEY comment_character_limit_2 ( comment_character_limit , email , email_verification , friends , language , message_character_limit ) , ADD KEY reg_req_about_2 ( reg_req_about , reg_req_birthday , reg_req_currentcity , reg_req_hometown , site_name , site_title , smooth_links , story_character_limit , theme ) ;

MySQL said: Documentation

1071 - Specified key was too long; max key length is 1000 bytes

查看下表

配置的表结构

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;

--

--转储表配置的数据

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');

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

最佳答案

这个问题有答案,会发表评论,但还没有要点呵呵。

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

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

关于php - 错误; #1071 - 指定的 key 太长;最大 key 长度为 1000 字节,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40336955/

相关文章:

php - MySQL DB,通过Python-PHP发送多条数据到服务器

php - PHP 中的基本整数除法失败 - 我一无所知

php - 如何在 Doctrine2 SELECT 查询中处理 DateTime 类型的默认值?

mysql - 属于或有一个 Sequelize

linux - Linux下增量备份MySQL Workbench的脚本

php - 在 URL 中添加组名并在没有索引页面的情况下访问该 URL

mysql - 如何创建MySQL分层递归查询

MySQL - 选择具有值的列并创建 'virtual column'

mysql - 从 Phpmyadmin 恢复数据库

mysql - Magento 错误 SQLSTATE [23000] : 1062 Duplicate entry log_visitor_info