Row size too large (> 8126)解決辦法
在MySQL5.7及以後版本中,在建立表、更改表等操作時,報ERROR 1118 (42000): Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.錯誤。如下所示:
mysql> SHOW VARIABLES LIKE 'innodb_strict_mode';
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| innodb_strict_mode | ON |
+--------------------+-------+
1 row in set (0.01 sec)
mysql> CREATE TABLE 'my_data' (
-> 'id' int(11) NOT NULL AUTO_INCREMENT,
-> 'mid' int(11) NOT NULL DEFAULT '1',
-> 'oid' bigint(20) NOT NULL,
...
-> 'txt' varchar(4) DEFAULT '-1',
-> PRIMARY KEY ('id'),
-> UNIQUE KEY 'count' ('app_count'),
-> UNIQUE KEY 'Email' ('txtEmail'),
-> KEY 'uid' ('uid') USING BTREE,
-> KEY 'idx_start_date' ('start_date')
-> ) ENGINE=InnoDB AUTO_INCREMENT=5258 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
ERROR 1118 (42000): Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline.
mysql> SHOW TABLES;
Empty set (0.00 sec)
可以通過臨時設定innodb_strict_mode為OFF,然後使報錯資訊以警告的方式提示,而不是直接以ERROR的方式中斷表的建立,如下所示。
mysql> SET SESSION innodb_strict_mode = OFF;
Query OK, 0 rows affected (0.00 sec)
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'VARA' at line 1
mysql> SHOW VARIABLES LIKE 'innodb_strict_mode';
+--------------------+-------+
| Variable_name | Value |
+--------------------+-------+
| innodb_strict_mode | OFF |
+--------------------+-------+
1 row in set (0.01 sec)
mysql> mysql> CREATE TABLE 'my_data' (
-> 'id' int(11) NOT NULL AUTO_INCREMENT,
-> 'mid' int(11) NOT NULL DEFAULT '1',
-> 'oid' bigint(20) NOT NULL,
...
-> 'txt' varchar(4) DEFAULT '-1',
-> PRIMARY KEY ('id'),
-> UNIQUE KEY 'count' ('app_count'),
-> UNIQUE KEY 'Email' ('txtEmail'),
-> KEY 'uid' ('uid') USING BTREE,
-> KEY 'idx_start_date' ('start_date')
-> ) ENGINE=InnoDB AUTO_INCREMENT=5258 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC
->
-> ;
Query OK, 0 rows affected, 1 warning (0.12 sec)
mysql> SHOW WARNINGS;
+---------+------+----------------------------------------------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+----------------------------------------------------------------------------------------------------------------------------------------------+
| Warning | 139 | Row size too large (> 8126). Changing some columns to TEXT or BLOB may help. In current row format, BLOB prefix of 0 bytes is stored inline. |
+---------+------+----------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> SHOW TABLES;
+--------------------+
| Tables_in_test |
+--------------------+
| my_data |
+--------------------+
1 row in set (0.00 sec)
mysql>
也可以通過更改表的儲存引擎和儲存方式來臨時解決,最好還是調整表的設計,滿足資料庫要求的限制條件。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31403259/viewspace-2722872/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Mysql 報Row size too large 65535解決方法MySql
- #1118 - Row size too large. The maximum row size for the used table type, not counting BLOBs
- mysql Index column size too large 超過767錯誤解決方案(轉)MySqlIndex
- MySQL資料庫index column size too large. the maximum column size is 767 bytes問題解決MySql資料庫Index
- Index column size too large. The maximum column size is 767 bytesIndex
- 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
- 1709 - Index column size too large. The maximum column size is 767 bytes.Index
- nodejs Error: request entity too large解決方案NodeJSError
- [Err] 1709 - Index column size too large. The maximum column size is 767 bytes.Index
- gunzip時,提示file too large(問題已解決)
- 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
- -bash: /bin/rm: Argument list too long的解決辦法
- Java程式碼解決ElasticSearch的Result window is too large問題JavaElasticsearch
- Nginx出現413 Request Entity Too Large錯誤解決方法Nginx
- 啟動Amoeba報The stack size specified is too small解決方法
- mysql5.7 資料匯入5.6 Index column size too large. The maximum column size is 767 bytes.MySqlIndex
- 【解決方法】Dubbo報錯Data length too large,調整payload大小解決
- 帝國CMSr的Fatal error:Allowed memory size of的解決辦法Error
- insert:key too large to index…Index
- [Mark]解決ElasticSearch深度分頁機制中Result window is too large問題Elasticsearch
- Data too long for column 'name' at row 1 mysql的丟擲異常的解決辦法--之前方法不管用-要設定資料庫編碼MySql資料庫
- WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK!AIENQ
- github慢解決辦法Github
- Grub Rescue解決辦法
- /dev/null解決辦法devNull
- MSBuild Tools解決辦法UI
- ORA-00064: object is too large to allocate on this O/SObject
- 解決 Too many symbol filesSymbol
- 檔案無法粉碎解決辦法
- OpenStack 的NAT解決辦法
- android ExceptionInInitializerError解決辦法AndroidExceptionError
- Could not find *.apk!解決辦法APK
- man出錯解決辦法
- ARP病毒解決辦法
- 公寓噪音的解決辦法
- 【AWR】Suggestions if Your SYSAUX Tablespace Grows Rapidly or Too LargeUXAPI