mysql too many connections 解决备注

来源:互联网 发布:淘宝美工去哪里学 编辑:程序博客网 时间:2024/06/16 05:22

1.

A lot of sites only suffer from this problem when Google or any other search bot is visiting. The best way to resolve this is to add the 'Crawl-delay' parameter in your robots.txt or to set it to a higher number of seconds.


2.I found that maxing out all available connections is not the only way to have this error. If your disk on your MySQL server is full, you can also get this error. Clearing up disk space will rid of the error.


Full explanation of what I've encountered here: http://www.microshell.com/database/mysql/mysql-too-many-connection-errors/


3.The following can also be used to change max_connections:

mysql> SET GLOBAL max_connections = 200;

However, this only lasts until the MySQL Server restarts.


4.Another symptom for PHP users, the "max_connections" error being returned to the browsers and the "show processlist" filling up with sleeping threads: This can sometimes be alleviated by using the PHP .htaccess option to lower the connect timeout from the default 60 seconds.

php_value mysql.connect_timeout 20

原创粉丝点击