報(bào)改錯(cuò)誤是因?yàn)楸淼淖侄嗡饕L(zhǎng)度限制,解決辦法:
如果是阿里云數(shù)據(jù)庫(kù)
1人灼、進(jìn)入控制臺(tái)的參數(shù)設(shè)置里修改參數(shù)innodb_large_prefix為ON或者1顾翼,然后單擊提交參數(shù)
修改參數(shù)
2、創(chuàng)建表的時(shí)候指定表的row_format格式為Dynamic或者Compressed
create table idx_length_test_02
(
id int auto_increment primary key,
name varchar(255)
)
ROW_FORMAT=DYNAMIC default charset utf8mb4;
對(duì)已經(jīng)創(chuàng)建的表跪呈,修改表的row_format格式命令如下:
alter table <表名> row_format=dynamic;
alter table <表名> row_format=compressed;
如果不是阿里云數(shù)據(jù)庫(kù)則進(jìn)入數(shù)據(jù)庫(kù)操作頁(yè)輸入
set global innodb_file_format = BARRACUDA;
set global innodb_large_prefix = ON;