zoukankan      html  css  js  c++  java
  • apollo sql 报错: ERROR 1709 (HY000): Index column size too large. The maximum column size is 767 bytes.

    1.语句 (文章:https://segmentfault.com/a/1190000021131856)

    mysql> CREATE TABLE permissions (
        ->     role varchar(50) NOT NULL,
        ->     resource varchar(512) NOT NULL,
        ->     action varchar(8) NOT NULL,
        ->     constraint uk_role_permission UNIQUE (role,resource,action)
        -> );
    ERROR 1709 (HY000): Index column size too large. The maximum column size is 767 bytes.
    

    2.步骤

    mysql> show variables like 'innodb_large_prefix';
    +---------------------+-------+
    | Variable_name       | Value |
    +---------------------+-------+
    | innodb_large_prefix | OFF   |
    +---------------------+-------+
    1 row in set (0.00 sec)
    
    mysql> show variables like 'innodb_file_format';
    +--------------------+----------+
    | Variable_name      | Value    |
    +--------------------+----------+
    | innodb_file_format | Antelope |
    +--------------------+----------+
    1 row in set (0.00 sec)
    
    mysql> show variables like 'innodb_file_per_table';
    +-----------------------+-------+
    | Variable_name         | Value |
    +-----------------------+-------+
    | innodb_file_per_table | ON    |
    +-----------------------+-------+
    1 row in set (0.00 sec)
    
    mysql> set global innodb_large_prefix='on';
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> set global innodb_file_format='Barracuda';
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> show variables like 'innodb_large_prefix';
    +---------------------+-------+
    | Variable_name       | Value |
    +---------------------+-------+
    | innodb_large_prefix | ON    |
    +---------------------+-------+
    1 row in set (0.00 sec)
    
    mysql> show variables like 'innodb_file_format';
    +--------------------+-----------+
    | Variable_name      | Value     |
    +--------------------+-----------+
    | innodb_file_format | Barracuda |
    +--------------------+-----------+
    1 row in set (0.00 sec)
    
    mysql> CREATE TABLE permissions (
        ->     role varchar(50) NOT NULL,
        ->     resource varchar(512) NOT NULL,
        ->     action varchar(8) NOT NULL,
        ->     constraint uk_role_permission UNIQUE (role,resource,action)
        -> )  CHARSET=utf8 ROW_FORMAT=DYNAMIC;
    

    3.另外一种

  • 相关阅读:
    比较器 Comparable 与compartor 的区别及理解
    事务特性、事务隔离级别、spring事务传播特性
    分布式文件上传-FastDFS
    spring-cloud 组件总结以及搭建图示 (六)
    springCloud zuul网关(五)
    hashCode与equals 通过面试题一窥究竟
    【原】那年30岁
    【原】Hyper-V虚拟机设置外部网络访问
    【原】win10 .net framework 3.5安装
    【原】做梦有感
  • 原文地址:https://www.cnblogs.com/Applogize/p/15217914.html
Copyright © 2011-2022 走看看