Error Code: 1071 - Specified key was too long; max key length is 767 bytes


show variables like '%innodb_large_prefix%';
set global innodb_large_prefix=on;
show variables like '%innodb_file_format%';

保證innodb_file_format和innodb_file_format_max這兩個都是Barracuda
set global innodb_file_format=Barracuda;

使用這個命令查一下row_format是否爲Dynamic
show table status from MyDB where name='TEST';

是的話直接修改表中錯誤引起這個錯誤的字段,不是的話執行下面的命令

ALTER TABLE TEST ROW_FORMAT=DYNAMIC;

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章