当前位置:网站首页>[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 .
边栏推荐
- Arcpy 利用updatelayer函数改变图层的符号系统
- Configure cross compilation tool chain and environment variables
- 70000 words of detailed explanation of the whole process of pad openvino [CPU] - from environment configuration to model deployment
- How to implement cross domain requests
- webrtc 快速搭建 视频通话 视频会议
- Sort list tool class, which can sort strings
- Layoutmanager layout manager: flowlayout, borderlayout, GridLayout, gridbaglayout, CardLayout, BoxLayout
- MySQL learning notes 3 - JDBC
- 7. Agency mode
- FRP intranet penetration, reverse proxy
猜你喜欢

C语言中的函数(详解)

How to realize multi account login of video platform members

How to choose the middle-aged crisis of the testing post? Stick to it or find another way out? See below

剑指 Offer II 038. 每日温度

Leakage detection relay jy82-2p

Gridview出现滚动条,组件冲突,如何解决

MySQL learning notes 3 - JDBC

QT qtablewidget table column top requirements ideas and codes

webrtc 快速搭建 视频通话 视频会议

How to avoid JVM memory leakage?
随机推荐
740. Delete and get points
Stc8h development (XII): I2C drive AT24C08, at24c32 series EEPROM storage
注释与注解
双色球案例
Sword finger offer II 038 Daily temperature
Cloud native - SSH article that must be read on the cloud (commonly used for remote login to ECS)
24 magicaccessorimpl can access the debugging of all methods
509. Fibonacci number, all paths of climbing stairs, minimum cost of climbing stairs
[openvino+paddle] paddle detection / OCR / SEG export based on paddle2onnx
17-18. Dependency scope and life cycle plug-ins
[March 3, 2019] MAC starts redis
Arcpy uses the updatelayer function to change the symbol system of the layer
webrtc 快速搭建 视频通话 视频会议
Review | categories and mechanisms of action of covid-19 neutralizing antibodies and small molecule drugs
Design and implementation of redis 7.0 multi part AOF
27-31. Dependency transitivity, principle
1、 Relevant theories and tools of network security penetration testing
Which water in the environment needs water quality monitoring
Uninstall Google drive hard drive - you must exit the program to uninstall
Detectron: train your own data set -- convert your own data format to coco format