当前位置:网站首页>[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 .
边栏推荐
- AWT introduction
- 2022.7.2-----leetcode.871
- 11. Dimitt's law
- LayoutManager布局管理器:FlowLayout、BorderLayout、GridLayout、GridBagLayout、CardLayout、BoxLayout
- 对List进行排序工具类,可以对字符串排序
- After the festival, a large number of people change careers. Is it still time to be 30? Listen to the experience of the past people
- 体验碎周报第 102 期(2022.7.4)
- 70000 words of detailed explanation of the whole process of pad openvino [CPU] - from environment configuration to model deployment
- uniapp 自定義環境變量
- C language - Blue Bridge Cup - Snake filling
猜你喜欢
Overview of convolutional neural network structure optimization
198. House raiding
Detectron:训练自己的数据集——将自己的数据格式转换成COCO格式
Learning multi-level structural information for small organ segmentation
AWT常用组件、FileDialog文件选择框
Appium foundation - appium installation (II)
Arcpy uses the updatelayer function to change the symbol system of the layer
Learn about the Internet of things protocol WiFi ZigBee Bluetooth, etc. --- WiFi and WiFi protocols start from WiFi. What do we need to know about WiFi protocol itself?
How to get the parent node of all nodes in El tree
我的NVIDIA开发者之旅——优化显卡性能
随机推荐
How to choose the middle-aged crisis of the testing post? Stick to it or find another way out? See below
注释与注解
My NVIDIA developer journey - optimizing graphics card performance
C language exercises (recursion)
7. Agency mode
ES6 modularization
Cloud native - SSH article that must be read on the cloud (commonly used for remote login to ECS)
Nexus 6p downgraded from 8.0 to 6.0+root
复合非线性反馈控制(二)
Is the insurance annuity product worth buying? Is there a hole?
2022.7.2-----leetcode. eight hundred and seventy-one
C语言练习题(递归)
JS execution mechanism
Distributed cap theory
雲原生——上雲必讀之SSH篇(常用於遠程登錄雲服務器)
How to expand all collapse panels
如何实现视频平台会员多账号登录
1、 Relevant theories and tools of network security penetration testing
Reading notes of Clickhouse principle analysis and Application Practice (4)
Invalid revision: 3.18.1-g262b901-dirty