1. 程式人生 > >The maximum column size is 767 bytes

The maximum column size is 767 bytes

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

解決方案:

1.修改mysql

set global innodb_file_format = BARRACUDA;

set global innodb_large_prefix = ON;

set global innodb_file_per_table=ON;

 

檢視設定結果:

show variables like 'innodb_large_prefix';
show variables like 'innodb_file_format';
show variables like 'innodb_file_per_table';

結果

innodb_large_prefix:ON

innodb_file_format:Barracuda

innodb_file_per_table:ON

2.對指令碼進行修改,新增ROW_FORMAT=DYNAMIC

create table orl (........) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;