The number of connections exceeds the value set by MySQL and is related to both max_connections and wait_timeout. The larger the value of the wait_timeout, the longer the idle wait for the connection, which causes the current number of connections to become larger.
windows resolves MySQL Errno.: 1040 Error
XXXX Info:can not connect to MySQL server
User:root
Time:2004-5-20 3:00pm
Script:/xxxx/xxxx.php
Error:too Many connections
Errno.: 1040
An error in the has been dispatched to our administrator.
Workaround:
Modify the parameters in the MySQL configuration file (My.ini under Windows, MY.CNF under Linux):
The code is as follows |
Copy Code |
max_connections= 1000 Wait_timeout = 5 |
If you cannot add it yourself, restart MySQL after you modify it.
If it is the Linux system we modify
/ETC/MYSQL/MY.CNF, add the following line:
The code is as follows |
Copy Code |
Set-variable = max_connections=500 |
Or add parameters to the startup command max_connections=500