bug_x

导航

 

 ERROR app.wsutils 419 INCRON: Error: ('HY000', '[HY000] [MySQL][ODBC 5.2(w) Driver][mysqld-5.7.7-rc-log]Index column size too large. The maximum column size is 767 bytes. (1709) (SQLExecDirectW)')

 

网上查找解决方案是:

set global innodb_file_format = BARRACUDA;
set global innodb_large_prefix = ON;
create table test (........) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;

或者:
innodb_file_format = Barracuda
innodb_file_per_table = 1
innodb_large_prefix

还有一种情况是:创建表的时候出现的:解决方式是:删除之前的索引:
原文链接:http://stackoverflow.com/questions/24853828/index-column-size-too-large-the-maximum-column-size-is-767-bytes-for-int-dat

摘录:
    CREATE TABLE IF NOT EXISTS  `db`.`TAGS` (

 `tag_id` INT( 11 ) NOT NULL ,
 `tag_text` VARCHAR( 700 ) NULL ,
 `date_added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
 `xxx_id` INT( 11 ) NOT NULL COMMENT  'This is for ease of reference lookup later',
 `user_id` INT( 11 ) NOT NULL ,
 `TAG_FACT_RELATION_relation_id` INT NOT NULL ,
PRIMARY KEY (  `tag_id` ) ,
UNIQUE INDEX  `tag_UNIQUE` (  `tag_text` ASC ) ,
UNIQUE INDEX  `tag_id_UNIQUE` (  `tag_id` ASC ) ,
INDEX  `fk_TAGS_TAG_FACT_RELATION1_idx` (  `TAG_FACT_RELATION_relation_id` ASC ) ,
CONSTRAINT  `fk_TAGS_TAG_FACT_RELATION1` FOREIGN KEY (  `TAG_FACT_RELATION_relation_id` ) REFERENCES  `meepl`.`TAG_FACT_RELATION` (
`relation_id`
) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE = INNODB;

There error says:

#1709 - Index column size too large. The maximum column size is 767 bytes.

其他mysql官方:设置innodb :
https://dev.mysql.com/doc/refman/5.5/en/innodb-restrictions.html

 

posted on 2017-05-22 09:15  bug_x  阅读(3197)  评论(0编辑  收藏  举报