本篇文章主要介绍了"MySQL Study之--“too many connections”错误解决方案",主要涉及到方面的内容,对于其他数据库感兴趣的同学可以参考一下:
MySQL Study之--“too many connections”错误解决方案错误信息如下:Can not connect to MySQL server...
MySQL Study之--“too many connections”错误解决方案
错误信息如下:
Can not connect to MySQL server
Error: Too many connections
Errno.: 1040
Similar error report has beed dispatched to administrator before.
以下是mysql.com网站的相关说明:
If you get a Too many connections error when you try to connect to the mysqld server, this means that all available connections are in use by other clients.
The number of connections allowed is controlled by the max_connections system variable. Its default value is100. If you need to support more connections, you should restart mysqld with a larger value for this variable.
mysqld actually allows max_connections+1 clients to connect. The extra connection is reserved for use by accounts that have the SUPER privilege. By granting the SUPER privilege to administrators and not to normal users (who should not need it), an administrator can connect to the server and useSHOW PROCESSLIST to diagnose problems even if the maximum number of unprivileged clients are connected. See Section 13.5.4.19, “SHOW PROCESSLIST Syntax”.
The maximum number of connections MySQL can support depends on the quality of the thread library on a given platform. Linux or Solaris should be able to support 500-1000 simultaneous connections, depending on how much RAM you have and what your clients are doing. Static Linux binaries provided by MySQL AB can support up to 4000connections.
解决方法:
1、修改my.cnf配置文件