問題是我的表沒有2G: mysql> select * from information_schema.tables where table_name='test' /G *************************** 1. row *************************** TABLE_CATALOG: def TABLE_SCHEMA: test TABLE_NAME: test TABLE_TYPE: BASE TABLE ENGINE: MEMORY VERSION: 10 ROW_FORMAT: Fixed TABLE_ROWS: 1778 AVG_ROW_LENGTH: 9440 DATA_LENGTH: 16855944 MAX_DATA_LENGTH: 16765440 INDEX_LENGTH: 0 DATA_FREE: 0 AUTO_INCREMENT: NULL CREATE_TIME: 2016-09-19 13:45:37 UPDATE_TIME: NULL CHECK_TIME: NULL TABLE_COLLATION: utf8_general_ci CHECKSUM: NULL CREATE_OPTIONS: TABLE_COMMENT: 1 row in set (0.00 sec)
大約16M, 另一個有用的信息是這個表的存儲引擎是 MEMORY. 這個是由于 create table test like information_schema.tables, create table test1 like test; 而information_schema.tables是tables表是memory存儲引擎所致。
而 memory 的大小受到 'max_heap_table_size' 參數(shù)影響 mysql> show variables like 'max_heap_table_size'; +---------------------+----------+ | Variable_name | Value | +---------------------+----------+ | max_heap_table_size | 16777216 | +---------------------+----------+
修改此參數(shù)大小驗證一下: set max_heap_table_size=167772160 還是報錯。