---
title: "做网站出现的bug（二）"
author: "soboer"
date: "2011-11-30T14:18:00Z"
tags: []
slug: "bug"
draft: false
lastmod: "2011-11-30T15:29:52Z"
id: 1285761
url: "https://soboer.iteye.com/blog/1285761"
---

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

连接风信网官网 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\_timeout 都有关系。wait\_timeout 的值越大，连接的空闲等待就越长，这样就会造成当前连接数越大。  
解决方法：  
1、虚拟主机用户请联系空间商优化 MySQL 服务器的配置；  
2、独立主机用户请联系服务器管理员优化 MySQL 服务器的配置，可参考：  
修改 MySQL 配置文件（Windows下为 my.ini， Linux下为 my.cnf ）中的参数：  
max\_connections= 1000  
wait\_timeout = 5  
如果没有可以自行添加，修改后重启 MySQL ，如果经常性的报此错误，请做一下服务器的整体优化。  
TAG标签： MySQL 错误 Too many connections Errno  
顶一下  
(0)  
0.00%  
踩一下  
(0)  
0.00%