Home  >  Article  >  Database  >  mysql建库时提示Specified key was too long max key length is_MySQL

mysql建库时提示Specified key was too long max key length is_MySQL

WBOY
WBOYOriginal
2016-06-01 13:38:371254browse

bitsCN.com


mysql建库时提示Specified key was too long max key length is 1000 bytes的问题

 

索引字段长度太长, 

网上搜到解决方法:  

1.修改字段长度 

2.修改mysql默认的存储引擎 

在/etc/mysql/my.cnf 的[mysqld] 下面加入default-storage-engine=INNODB 

 

但是在建库时已经明确表明了需要使用INNODB引擎 

 

Sql代码  

CREATE TABLE `acs` (  

  ...  

) ENGINE=InnoDB DEFAULT CHARSET=utf8;  

 

检查当前的引擎 

mysql> show engines; 

果然没有InnoDB 

 

查看是否支持动态加载, 重要的是have_dynamic_loading这行,如果是YES,那么继续 

mysql>show variables like "have_%";  

 

安装插件 

 

mysql> INSTALL PLUGIN INNODB SONAME 'ha_innodb.so'; 

 

mysql> show engines;
 

bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn