始于此, 终于斯
文章31
标签0
分类13

MySQL长字符字段开索引

在超长字段上创建索引时, 会报错:

ERROR 1709 (HY000): Index column size too large. The maximum column size is 767 bytes.

在my.ini中设置 innodb_large_prefix = 1

执行下面命令, 变更数据格式

alter table <表名> row_format=dynamic;
alter table <表名> row_format=compressed;

如果报错:

South migrate error, InnoDB: ROW_FORMAT=DYNAMIC requires innodb_file_format > Antelope

在my.ini中设置 innodb_file_format = Barracuda 再执行上述SQL

参考: https://stackoverflow.com/questions/23556926/south-migrate-error-innodb-row-format-dynamic-requires-innodb-file-format-an
https://help.aliyun.com/knowledge_detail/155946.html

    1 评论

    1. 1 12月6日 回复
      555