• ADADADADAD

    ERROR 1114 (HY000): The table 'test1' is full 的解决[ mysql数据库 ]

    mysql数据库 时间:2024-12-24 19:10:00

    作者:文/会员上传

    简介:

    今天执行sql碰到 1114的错误,如下:
    mysql> insert into test1 select * from test;
    Query OK, 1778 rows affected (0.06 sec)
    Records: 1778 Duplicates: 0 Warnings: 0mysql

    以下为本文的正文内容,内容仅供参考!本站为公益性网站,复制本文以及下载DOC文档全部免费。

    今天执行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:



    ERROR 1114 (HY000): The table 'test1' is full 的解决.docx

    将本文的Word文档下载到电脑

    推荐度:

    下载
    热门标签: 解决1114