The column size is too large. The maximum column size is 767 bytes. - For data type INT?

I know innodb imposes a key size limit, but INT?

    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 the error says:

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

Any ideas? I have been dealing with data types for a long time.

+1
source share
1 answer

A bit late, but I had a similar problem.

The column tag_texthas UNIQUE_INDEX, and that is what causes the problem, not the INT data type.

Modify the MySql installation to include larger index columns by enabling innodb_large_prefix.

See http://dev.mysql.com/doc/refman/5.5/en/innodb-restrictions.html

+2
source

All Articles