设为首页 - 加入收藏 ASP站长网(Aspzz.Cn)- 科技、建站、经验、云计算、5G、大数据,站长网!
热搜: 创业者 数据 手机
当前位置: 首页 > 站长学院 > MySql教程 > 正文

ERROR 1114 HY000 The table test1 is full 的解决

发布时间:2022-04-08 10:28 所属栏目:115 来源:互联网
导读:今天执行sql碰到 1114的错误,如下: mysql insert into test1 select * from test; Query OK, 1778 rows affected (0.06 sec) Records: 1778 Duplicates: 0 Warnings: 0 mysql insert into test1 select * from test; ERROR 1114 (HY000): The table test1
       今天执行sql碰到 1114的错误,如下:
       mysql> insert into test1 select * from test;
       Query OK, 1778 rows affected (0.06 sec)
       Records: 1778  Duplicates: 0  Warnings: 0
 
mysql> insert into test1 select * from test;
ERROR 1114 (HY000): The table 'test1' is full
 
查看官方的文档,并没有答案,里面说到操作系统文件的限制引起了这个错误,可以理解,操作系统单个文件大小最大是2G,那么采用innodb_file_per_table=on 时,会把一个表数据创建在一个文件中,那么这个表数据的大小只能是2G了。
http://dev.mysql.com/doc/refman/5.7/en/full-table.html
 
问题是我的表没有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' 参数影响
mysql> show variables like 'max_heap_table_size';
+---------------------+----------+
| Variable_name       | Value    |
+---------------------+----------+
| max_heap_table_size | 16777216 |
+---------------------+----------+
 
修改此参数大小验证一下:
set max_heap_table_size=167772160
还是报错。
 
 
根据网上的资料,修改my.cnf文件,然后重新启动:
tmp_table_size = 256M
max_heap_table_size = 256M
 
再次执行就可以了
mysql> insert into test2 select * from test2;
Query OK, 9216 rows affected (1.22 sec)
Records: 9216  Duplicates: 0  Warnings: 0
 
此时表的最大长度也变为 256M了。
mysql> select * from information_schema.tables where table_name='test2' \G
*************************** 1. row ***************************
  TABLE_CATALOG: def
   TABLE_SCHEMA: test
     TABLE_NAME: test2
     TABLE_TYPE: BASE TABLE
         ENGINE: MEMORY
        VERSION: 10
     ROW_FORMAT: Fixed
     TABLE_ROWS: 18432
 AVG_ROW_LENGTH: 9440
    DATA_LENGTH: 174807384
MAX_DATA_LENGTH: 268313120
   INDEX_LENGTH: 0
      DATA_FREE: 0
 AUTO_INCREMENT: NULL
    CREATE_TIME: 2016-09-19 14:37:29
    UPDATE_TIME: NULL
     CHECK_TIME: NULL
TABLE_COLLATION: utf8_general_ci
       CHECKSUM: NULL
 CREATE_OPTIONS:
  TABLE_COMMENT:
 

(编辑:ASP站长网)

    网友评论
    推荐文章
      热点阅读