当前位置:网站首页>[problem record] 03 connect to MySQL database prompt: 1040 too many connections
[problem record] 03 connect to MySQL database prompt: 1040 too many connections
2022-07-04 06:29:00 【joinclear】
1、 The error information is as follows :
Connect MySQL Database prompt :1040 Too many connections:
2、 reason :
Due to the number of database connections , The maximum number of connections to the database has been exceeded .
PS: Because these database connections , be in sleep state , But it has not been cleared away .
View reasons :
1) Log in to the database
logon server , Enter the command :
mysql -uroot -p
Enter the database login password , Login successful .
2) View database process status
show status like 'Threads%';
treads_cached : Number of threads in the buffer pool .
Threads_connected: Current connection ( Running and sleeping ) Number of threads in .
Threads_created : The number of threads that have created connections .
Threads_running: Currently running ( No sleep ) Number of threads in .
A total of :152 individual .
3) View the maximum number of database connections
show variables like '%max_connection%';
maximum connection :151 individual , Less than the current total number of connections 152, So the tip :Too many connections.
4) View clear Sleep Connection time
show variables like 'wait_timeout';
The clearance interval is :28800 second (8 Hours ), After connection 8 Hours clear .
3、 resolvent :
The solution priority is as follows 1、2、3 The order of :
1) Troubleshoot code problems
See where there are too many connections , It may be caused by code, such as scheduled tasks .
2) Increase the maximum number of connections
set GLOBAL max_connections=1000;
such as , Change it to 1000 Number of connections :
3) Reduce and clear Sleep Connection time
set GLOBAL wait_timeout=14400;
Change to 4 Hours or shorter intervals .
边栏推荐
- Detectron:训练自己的数据集——将自己的数据格式转换成COCO格式
- Invalid revision: 3.18.1-g262b901-dirty
- 分布式CAP理论
- Impact relay jc-7/11/dc110v
- Uniapp custom environment variables
- How to choose the middle-aged crisis of the testing post? Stick to it or find another way out? See below
- Sword finger offer II 038 Daily temperature
- 对List进行排序工具类,可以对字符串排序
- Uninstall Google drive hard drive - you must exit the program to uninstall
- Qt发布多语言国际化翻译
猜你喜欢
4G wireless all network solar hydrological equipment power monitoring system bms110
Uniapp custom environment variables
Arcpy 利用updatelayer函数改变图层的符号系统
uniapp 自定义环境变量
《ClickHouse原理解析与应用实践》读书笔记(4)
[March 3, 2019] MAC starts redis
Impact relay jc-7/11/dc110v
C # symmetric encryption (AES encryption) ciphertext results generated each time, different ideas, code sharing
双色球案例
C语言中的函数(详解)
随机推荐
双色球案例
Stc8h development (XII): I2C drive AT24C08, at24c32 series EEPROM storage
Variables d'environnement personnalisées uniapp
Yiwen unlocks Huawei's new cloud skills - the whole process of aiot development [device access - ESP end-to-side data collection [mqtt]- real time data analysis] (step-by-step screenshot is more detai
剑指 Offer II 038. 每日温度
AWT常用组件、FileDialog文件选择框
STM32 单片机ADC 电压计算
AWT common components, FileDialog file selection box
注释与注解
如何实现视频平台会员多账号登录
How to get the parent node of all nodes in El tree
我的NVIDIA开发者之旅——优化显卡性能
Learning multi-level structural information for small organ segmentation
Design and implementation of redis 7.0 multi part AOF
QT qtablewidget table column top requirements ideas and codes
Nexus 6p从8.0降级6.0+root
How to choose the middle-aged crisis of the testing post? Stick to it or find another way out? See below
Sword finger offer II 038 Daily temperature
JS flattened array of number shape structure
复合非线性反馈控制(二)