当前位置:网站首页>Solution for MySQL The table is full
Solution for MySQL The table is full
2022-07-31 06:23:00 【web15085599741】
The size of the memory table exceeds the specified range
MySQL has the problem of "the table is full", generally for two reasons:
One, need to increase the size of the data table
vi /etc/my.cnfYou need to modify the MySQL configuration file my.cnf, add/modify two lines under [mysqld]:
tmp_table_size = 1024Mmax_heap_table_size = 1024MThe system default is 16M, restart mySQL after modification
Second, the hard disk space of the server is full, just clean up the garbage/useless data
#Query server space usagedf -hQuery MySQL storage directory storage usage
#Query the size of all files in a specific directorydu -sh /usr/data/*tmp_table_size
Memory cache size of temporary table
(Temporary table refers to the temporary data table generated when sql is executed)
# tmp_table_sizeDefault value 16777216Minimum 1Maximum 18446744073709551615// The unit byte default value is more than 16MView tmp_table_sizeshow global variables like 'tmp_table_size';
Set tmp_table_sizeset global tmp_table_size= 1073741824; (effective immediately after restart)
Add tmp_table_size under mysqld in the MySQL configuration file my.cnf[mysqld]tmp_table_size = 100000000
First of all, when optimizing SQL, you should try to avoid temporary tables
If you must use temporary tables and execute a large number of SQL at the same time to generate a large number of temporary tables, increase tmp_table_size appropriately
If the amount of data generated in the temporary table is greater than tmp_table_size, thenStore temporary tables on disk instead of memory
Note
[max_heap_table_size in MySQL
](https://link.jianshu.com/t=https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_max_heap_table_size) parameter also affectsThe memory cache size of the temporary table max_heap_table_size is the table size of the MEMORY memory engine because the temporary table is also a memory table, so it is also limited by this parameter, so if you want to increase the The size of tmp_table_size also needs to increase the size of max_heap_table_size
You can analyze whether you need to increase tmp_table_size
Created_tmp_disk_tables and Created_tmp_tablesView Statusshow global status like 'Created_tmp_disk_tables';show global status like 'Created_tmp_tables';Created_tmp_disk_tables : number of disk temporary tablesCreated_tmp_tables : the number of in-memory temporary tablesMySQL5.7 Reference Manual - tmp_table_size
Related articles on MySQL memory allocation
http://mysql.rjweb.org/doc.php/memory
My Personal Blog
https://blog.52ipc.top/p>
Let me introduce myself first. The editor graduated from Shanghai Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Alibaba in 2018, until now.I know that most junior and intermediate java engineers want to upgrade their skills, they often need to explore their own growth or sign up to study, but for training institutions, the tuition fee is nearly 10,000 yuan, which is really stressful.Self-learning that is not systematic is very inefficient and lengthy, and it is easy to hit the ceiling and the technology stops.Therefore, I collected a "full set of learning materials for java development" for everyone. The original intention is also very simple. I hope to help friends who want to learn by themselves but don't know where to start, and at the same time reduce everyone's burden.Add the business card below to get a full set of learning materials
边栏推荐
猜你喜欢

Embedding cutting-edge understanding

机器学习和深度学习概述

VS2017 connects to MYSQL

使用 OpenCV 提取图像的 HOG、SURF 及 LBP 特征 (含代码)

ROS之service编程的学习和理解

DSPE-PEG-COOH CAS: 1403744-37-5 Phospholipid-polyethylene glycol-carboxy lipid PEG conjugate

【解决问题】RuntimeError: The size of tensor a (80) must match the size of tensor b (56) at non-singleton

VS2017连接MYSQL

Global scope and function scope in js

PyTorch学习笔记08——加载数据集
随机推荐
浏览器查找js绑定或者监听的事件
数据预处理、特征工程和特征学习-摘抄
Pytorch实现ResNet
MYSQL事务与锁问题处理
禅道安装及使用教程
unicloud cloud development record
ROS之service编程的学习和理解
Sqlite column A data is copied to column B
VS通过ODBC连接MYSQL(二)
2021年软件测试面试题大全
break and continue exit in js
CAS: 1403744-37-5 DSPE-PEG-FA Phospholipid-Polyethylene Glycol-Folic Acid for Scientific Research
Flow control statement in js
Tensorflow——demo
Cholesterol-PEG-Acid CLS-PEG-COOH Cholesterol-Polyethylene Glycol-Carboxyl Modified Peptides
VS2017连接MYSQL
TransactionTemplate transaction programmatic way
IDEA控制台不能输入信息的解决方法
Gradle sync failed: Uninitialized object exists on backward branch 142
四种常见的POST提交数据方式