Index column size too large. The maximum column size is 767 bytes.
在MySQL資料庫上建立索引時,出現錯誤Index column size too large. The maximum column size is 767 bytes.
由於 MySQL Innodb 引擎表索引欄位長度的限制為 767 位元組,因此對於多位元組字符集的大欄位(或者多欄位組合索引),建立索引會出現上面的錯誤。
解決方案
Step 1 :設定引數 innodb_large_prefix 為 ON
set global innodb_file_format = BARRACUDA;
set global innodb_large_prefix = ON;
Step 2:建立表的時候指定表的 row format 格式為 Dynamic 或者 Compressed
create table tb_name
(
……
)
ROW_FORMAT=DYNAMIC ENGINE=InnoDB DEFAULT CHARSET=utf8;
Step 3:對於已經建立的表修改表的row_format
alter table <table_name> row_format=dynamic;
alter table <table_name> row_format=compressed;
經過上述步驟之後,再繼續建立索引就可以成功了。
alter table <table_name> add unique index(column_name);
相關文章
- 1709 - Index column size too large. The maximum column size is 767 bytes.Index
- [Err] 1709 - Index column size too large. The maximum column size is 767 bytes.Index
- mysql specified key was too long與Index column size too large. The maximum column size is 767 bytes.MySqlIndex
- mysql5.7 資料匯入5.6 Index column size too large. The maximum column size is 767 bytes.MySqlIndex
- MySQL建立表失敗:Index column size too large. The maximum column size is 767 bytesMySqlIndex
- MySQL 5.7 到 5.6,出現 Index column size too large. The maximum column size is 767 bytesMySqlIndex
- MySQL資料庫index column size too large. the maximum column size is 767 bytes問題解決MySql資料庫Index
- mysql Index column size too large 超過767錯誤解決方案(轉)MySqlIndex
- #1118 - Row size too large. The maximum row size for the used table type, not counting BLOBs
- data too long for column
- ORA-12899: value too large for column ORG_NAME (actual: 145, maximum: 128)
- Bug 31625618 DML Over a LOB Column ORA-3137 [3146]When the Bind Size is > 256k
- Row size too large (> 8126)解決辦法
- java.lang.IndexOutOfBoundsException: Index: 0, Size: 0JavaIndexException
- Unhandled rejection RangeError: Maximum call stack size exceededill install loadIdealTreeErrorIdea
- ORA-01144: File size (4224000 blocks) exceeds maximum of 4194303BloC
- ProTable 報錯Uncaught RangeError: Maximum call stack size exceededError
- Mysql 報Row size too large 65535解決方法MySql
- [20180608]Wrong Results with IOT, Added Column and Secondary Index.txtIndex
- js中Uncaught RangeError: Maximum call stack size exceeded錯誤JSError
- [20180609]Wrong Results with IOT, Added Column and Secondary Index2.txtIndex
- 修改SharePoint上傳檔案大小限制(Changing Maximum Upload Size)
- 關於錯誤訊息 RangeError - Maximum call stack size exceeded at XXXError
- OGG-01163 Bad column length (32) specified for column in table
- Vue專案中出現:Maximum call stack size exceeded(堆疊溢位)Vue
- iis 0x80070032 Cannot read configuration file because it exceeds the maximum file size
- [20200904]12c invisible column impdp segment_column_id.txt
- Sorting arrays in NumPy by column
- CSS column-gapCSS
- CSS column-ruleCSS
- CSS column-widthCSS
- CSS column-spanCSS
- 5.6.7. Renaming a Column
- gitignore by file size?Git
- height_scale = scales[2] IndexError: index 2 is out of bounds for axis 0 with size 0IndexError
- ExtJs的Column佈局JS
- alter table set unused column
- Map size 屬性