mysql在執行腳本時,報出了以下錯誤:
index column size too large. the maximum column size is 767 bytes
解決方案:
1. 對數據庫進行設置
set global innodb_file_format = BARRACUDA
set global innodb_large_prefix = ON
注意: 在navicat中執行成功,不清楚重啟數據庫是否還有效
查看是否生效
show variables like 'character%';
show variables like 'collation_%';
show variables like 'innodb_large_prefix';
show variables like 'innodb_file_format';
2. 對腳本進行修改,添加ROW_FORMAT=DYNAMIC
create table test (........) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
參考文章:
https://stackoverflow.com/questions/30761867/mysql-error-the-maximum-column-size-is-767-bytes
轉載直接來源:
https://blog.csdn.net/pansanday/article/details/79375833