当前位置: 首页 > news >正文

ERROR 1114 (HY000): The table ‘tt2‘ is full

在这里插入图片描述
insert 操作时提示is full
问题原因

root@localhost 11:55:41 [t]>show table status from t like ‘tt2’ \G ;
*************************** 1. row ***************************
Name: tt2
Engine: MEMORY
Version: 10
Row_format: Fixed
Rows: 7056
Avg_row_length: 9440
Data_length: 67183232
Max_data_length: 67042880
Index_length: 0
Data_free: 0
Auto_increment: NULL
Create_time: 2023-02-13 11:47:46
Update_time: NULL
Check_time: NULL
Collation: utf8_general_ci
Checksum: NULL
Create_options:
Comment:
1 row in set (0.00 sec)

查看表信息,发现时memory 引擎表,大小刚好时64M。内存临时表大小超过max_heap_table_size时,就会报ERROR 1114 (HY000): The table ‘tt2’ is full

官方文档描述Memory 表大小受限于创建表时 max_heap_table_size

The maximum size of MEMORY tables is limited by the max_heap_table_size system variable, which
has a default value of 16MB. To enforce different size limits for MEMORY tables, change the value of
this variable. The value in effect for CREATE TABLE, or a subsequent ALTER TABLE or TRUNCATE
TABLE, is the value used for the life of the table. A server restart also sets the maximum size of existing
MEMORY tables to the global max_heap_table_size value. You can set the size for individual tables
as described later in this section

e.g:

root@localhost 12:21:08 [t]>set max_heap_table_size=2097152 ;

root@localhost 12:25:39 [t]>create table q1 like information_schema.tables ;
Query OK, 0 rows affected (0.02 sec)

root@localhost 12:25:46 [t]>insert into q1 select * from information_schema.tables ;
ERROR 1114 (HY000): The table ‘q1’ is full

root@localhost 12:26:45 [t]>set max_heap_table_size=20971520 ;

root@localhost 12:27:12 [t]>create table q2 like information_schema.tables ;
Query OK, 0 rows affected (0.02 sec)

root@localhost 12:27:18 [t]>insert into q2 select * from information_schema.tables ;
Query OK, 287 rows affected (0.33 sec)
Records: 287 Duplicates: 0 Warnings: 0

root@localhost 12:27:31 [t]>insert into q1 select * from information_schema.tables ;
ERROR 1114 (HY000): The table ‘q1’ is full

表的max_heap_table_size 跟建表时环境有关系
解决方案

方案1:

root@localhost 12:30:38 [t]>insert into q1 select * from information_schema.tables ;
ERROR 1114 (HY000): The table ‘q1’ is full

root@localhost 12:26:45 [t]>set max_heap_table_size=20971520 ;

root@localhost 12:32:30 [t]>alter table q1 engine = memory ;
Query OK, 224 rows affected (0.03 sec)
Records: 224 Duplicates: 0 Warnings: 0

root@localhost 12:32:38 [t]>insert into q1 select * from information_schema.tables ;
Query OK, 287 rows affected (0.33 sec)
Records: 287 Duplicates: 0 Warnings: 0

参考文档

The size of MEMORY tables is limited by the value of the max_heap_table_size system
variable, which is not replicated (see Section 17.5.1.38, “Replication and Variables”). A change in
max_heap_table_size takes effect for MEMORY tables that are created or updated using ALTER
TABLE … ENGINE = MEMORY or TRUNCATE TABLE following the change, or for all MEMORY tables
following a server restart. If you increase the value of this variable on the master without doing so on
the slave, it becomes possible for a table on the master to grow larger than its counterpart on the slave,
leading to inserts that succeed on the master but fail on the slave with Table is full errors. This is
a known issue (Bug #48666). In such cases, you must set the global value of max_heap_table_size
on the slave as well as on the master, then restart replication. It is also recommended that you restart
both the master and slave MySQL servers, to insure that the new value takes complete (global) effect
on each of them.

http://www.lryc.cn/news/9994.html

相关文章:

  • 考了PMP证后工资大概是多少 ?(含pmp资料)
  • 基于国产龙芯 CPU 的气井工业网关研究与设计(一)
  • 40/365 javascript 数据类型
  • 后勤管理系统—服务台管理功能
  • Spring Boot 是什么,应该如何学习,有哪些优缺点
  • 使用yolov5和强化学习训练一个AI智能欢乐斗地主(一)
  • C++ 浅谈之 AVL 树和红黑树
  • 【Kotlin】Kotlin函数那么多,你会几个?
  • 饲养员喂养动物-课后程序(JAVA基础案例教程-黑马程序员编著-第四章-课后作业)
  • 数据分析:消费者数据分析
  • Transformer论文阅读:ViT算法笔记
  • Android基础练习解答【2】
  • k8s 搭建
  • 安全运维之mysql基线检查
  • 跨境电商卖家敦煌、雅虎、乐天、亚马逊测评自养号的重要性!
  • Python 之 Matplotlib xticks 的再次说明、图形样式和子图
  • 3.InfluxDB WEB使用
  • git冲突合并
  • 项目自动化构建工具make/Makefile
  • 双目客流统计方案的应用原理
  • python魔术方法(二)
  • cmd for命令笔记
  • 4.1 Filter-policy
  • day15_常用类
  • 【网络原理5】IP协议篇
  • Unity导出WebGL工程,并部署本地web服务器
  • 蓝桥杯考试总结汇总
  • 备战蓝桥杯【二维前缀和】
  • 阿里P6细谈Python简易接口自动化测试框架设计与实现,我直呼内行
  • 数据库存储