美文网首页
mysql:Index column size too larg

mysql:Index column size too larg

作者: daodao072 | 来源:发表于2019-10-04 16:14 被阅读0次

    Error: Index column size too large. Themaximum column size is 767 bytes. (state=HY000,code=1709)

    主要是创建索引时候字段不能超过767。这是MySQL的限制

    如果mysql 是5.6 以上版本可以用以下方法,select version() from dual;  查看版本

    SET GLOBAL innodb_file_format = Barracuda;

    SET GLOBAL innodb_file_per_table = ON;

    SET GLOBAL innodb_large_prefix = ON;

    退出MySQL在登陆验证参数

    show variables like 'innodb_file_format';

    以上方法是方法应该能够解决大部分问题。如果重启mysql和amber-agent还是不行,

    操作入小。查看具体的表例如表PART_COL_STATS,作如下修改

    alter table PART_COL_STATS row_format=dynamic;

    此方法需要修改所有涉及索引超过767 的表

    相关文章

      网友评论

          本文标题:mysql:Index column size too larg

          本文链接:https://www.haomeiwen.com/subject/ntmyfftx.html