当前位置:网站首页>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
边栏推荐
猜你喜欢

MW:3400 4-Arm PEG-DSPE 四臂-聚乙二醇-磷脂一种饱和的18碳磷脂

VS2017 connects to MYSQL

Understanding of js arrays

2021-09-30

Notes on creating a new virtual machine in Hyper-V

2022年SQL大厂高频实战面试题(详细解析)

box-shadow相关属性

四种常见的POST提交数据方式

mPEG-DSPE 178744-28-0 甲氧基-聚乙二醇-磷脂酰乙醇胺线性PEG磷脂

Gradle sync failed: Uninitialized object exists on backward branch 142
随机推荐
超参数优化-摘抄
function in js
Embedding前沿了解
DSPE-PEG-Biotin, CAS: 385437-57-0, phospholipid-polyethylene glycol-biotin prolongs circulating half-life
CNN的一点理解
mPEG-DSPE 178744-28-0 甲氧基-聚乙二醇-磷脂酰乙醇胺线性PEG磷脂
化学试剂磷脂-聚乙二醇-氨基,DSPE-PEG-amine,CAS:474922-26-4
科学研究用磷脂-聚乙二醇-活性酯 DSPE-PEG-NHS CAS:1445723-73-8
Tensorflow——demo
用pytorch里的children方法自定义网络
Cholesterol-PEG-Azide CLS-PEG-N3 Cholesterol-PEG-Azide MW:3400
微信小程序源码获取与反编译方式
Fluorescein-PEG-DSPE Phospholipid-Polyethylene Glycol-Fluorescein Fluorescent Phospholipid PEG Derivatives
2022 SQL big factory high-frequency practical interview questions (detailed analysis)
Global scope and function scope in js
2021-09-30
如何修改数据库密码
Software Testing Interview Questions 2021
活体检测CDCN学习笔记
pyspark.ml feature transformation module