Home > Database > Mysql Tutorial > body text

解决MySQL错误:Too many connections

WBOY
Release: 2016-06-07 17:54:06
Original
1519 people have browsed it

连接风信网官网 http://www.ithov.com 突然出现如下错误: MySQL Error Message: Can not connect to MySQL server SQL: Error: Too many connections Errno.: 1040 Click here to seek help. 连接数超过了 MySQL 设置的值,与 max_connections 和 wait_time

连接风信网官网  突然出现如下错误:

MySQL Error
Message: Can not connect to MySQL server
SQL:
Error: Too many connections
Errno.: 1040
Click here to seek help.

连接数超过了 MySQL 设置的值,与 max_connections 和 wait_timeout  都有关系。wait_timeout 的值越大,连接的空闲等待就越长,这样就会造成当前连接数越大。

解决方法:

1、虚拟主机用户请联系空间商优化 MySQL 的配置;

2、独立主机用户请联系服务器管理员优化 MySQL 服务器的配置,可参考:

修改 MySQL 配置文件(Windows下为 my.ini, Linux下为 my.cnf )中的参数:

max_connections= 1000
wait_timeout = 5

如果没有可以自行添加,修改后重启 MySQL ,如果经常性的报此错误,请做一下服务器的整体优化。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template