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
- Index column size too large. The maximum column size is 767 bytesIndex
- 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
- MySQL:Specified key was too long; max key length is 767 bytesMySql
- #1118 - Row size too large. The maximum row size for the used table type, not counting BLOBs
- 解決 Specified key was too long ... 767 bytes 的本質問題
- 偶遇ERROR 1071 (42000): Specified key was too long; max key length is 767 bytesError
- Laravel 5.4 常見錯誤:Specified key was too longLaravel
- Specified key was too long; max key length is 1000 bytes
- 啟動Amoeba報The stack size specified is too small解決方法
- Laravel 5.5 資料遷移問題:Specified key was too longLaravel
- Mysql 報Row size too large 65535解決方法MySql
- insert:key too large to index…Index
- 執行遷移檔案報錯 1071 Specified key was too long.
- Mysql Key Buffer SizeMySql
- Row size too large (> 8126)解決辦法
- C# The file is too long. This operation is currently limited to supporting files less than 2 gigabytes in size.C#MIT
- 【MOS】Index Rebuild Is Hanging Or Taking Too Long (文件 ID 272762.1)IndexRebuild
- 高效的SQL(index values與index column values關係?)SQLIndex
- 在windows的DOS視窗下執行mysql命令,insert語句中只要含有漢字資料就出現“data too long for column”錯誤 。 ...WindowsMySql
- ORA-01704: string literal too long 與CLOB
- WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK!AIENQ
- AST is too big. Maximum: 500000 處理AST
- Data too long for column 'name' at row 1 mysql的丟擲異常的解決辦法--之前方法不管用-要設定資料庫編碼MySql資料庫
- PLS-00172: string literal too long
- 0403-027 The parameter list is too long for AIXAI
- Key Attribute和Key Column:蘋果和桔子蘋果
- WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK! 與 dc_tablespcesAIENQ
- ORA-28348, encryption column TDE, function indexFunctionIndex
- 故障排除:"WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK! "AIENQ
- WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK!的分析AIENQ
- MySQL: Too many connectionsMySql