mysql specified key was too long與Index column size too large. The maximum column size is 767 bytes.
第一個問題:要設定utf-8就好;
Index column size too large. The maximum column size is 767 bytes.
第一步:use 進入資料庫
執行:
set global innodb_file_format = BARRACUDA;
set global innodb_large_prefix = ON;
第二步:執行
CREATE TABLE `app_item_rank_increment_hour` (
`at` varchar(20) NOT NULL,
`appv` varchar(20) NOT NULL,
`channel` varchar(20) NOT NULL,
`item_id` varchar(50) NOT NULL,
`rise` int(11) DEFAULT NULL,
`current_rank` int(11) DEFAULT NULL,
`day` int(10) NOT NULL,
`hour` int(10) NOT NULL,
`item_url` varchar(300) NOT NULL,
`item_title` varchar(150) NOT NULL,
PRIMARY KEY (`at`,`appv`,`channel`,`item_id`,`day`,`hour`,`item_title`,`item_url`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
標紅為修改部分;
注意:使用圖片中的方式在載入,會影響後面的表加入,如果不想影響可以進入mysql
使用source 命令載入,執行影響整一個表,不會影響後面的表
但一樣不建議是用這種方式,這個引數會改了儲存引擎的格式型別
最好檢查mysql版本,使用相同版本則不會出現問題,
我是用的是5.6的版本,原sql使用的5.7的班版本,後面發現只要使用5.7以上的版本就不會出現這個問題
相關文章
- Index column size too large. The maximum column size is 767 bytes.Index
- 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
- 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
- data too long for column
- #1118 - Row size too large. The maximum row size for the used table type, not counting BLOBs
- 偶遇ERROR 1071 (42000): Specified key was too long; max key length is 767 bytesError
- 解決 Specified key was too long ... 767 bytes 的本質問題
- Specified key was too long; max key length is 1000 bytes
- ORA-12899: value too large for column ORG_NAME (actual: 145, maximum: 128)
- Mysql 報Row size too large 65535解決方法MySql
- 執行遷移檔案報錯 1071 Specified key was too long.
- Row size too large (> 8126)解決辦法
- Mysql Key Buffer SizeMySql
- C# The file is too long. This operation is currently limited to supporting files less than 2 gigabytes in size.C#MIT
- OGG-01163 Bad column length (32) specified for column in table
- Error running ‘Application’Command line is too longErrorAPP
- AST is too big. Maximum: 500000 處理AST
- ORA-01489: result of string concatenation is too long
- Bug 31625618 DML Over a LOB Column ORA-3137 [3146]When the Bind Size is > 256k
- 關於Argument list too long的問題
- 最佳化mysql之key_buffer_size設定MySql
- File name too long window和linux排查,解決Linux
- java.lang.IndexOutOfBoundsException: Index: 0, Size: 0JavaIndexException
- SAP:CX_SY_READ_SRC_LINE_TOO_LONG解決
- 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 ERROR 1040: Too many connectionsMySqlError
- mysql中key 、primary key 、unique key 與index區別MySqlIndex
- [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
- 刪除大量檔案Argument list too long錯誤解決