Forum Moderators: coopster

Message Too Old, No Replies

could not connect to MySQL: Too many connections

         

mgm_03

8:06 pm on Aug 16, 2005 (gmt 0)

10+ Year Member



Alrighty....this is a new error message I've not encountered before.

looking at the phpinfo data, it says mysql.max_links is "unlimited"

I'm using mysql_connect (vs pconnect).

When I try inserting mysql_close() in my functions, I get the :

Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Any suggestions are appreciated

dreamcatcher

8:13 pm on Aug 16, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you on a shared server? If so contact your hosting company. Sounds like someone site is using up too many SQL resources. I`ve had it myself a few times.

dc

coopster

10:44 pm on Aug 16, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Are you specifying a hostname in your connect?

[dev.mysql.com...]

softwareengineer99

10:56 pm on Aug 16, 2005 (gmt 0)

10+ Year Member



This can happen when:

- there are too many connections. Increase values in /etc/my.cnf for (max_connections=XXX)

- existing connections are opened and waiting for long. Decrease value of wait_timeout=XX if possible.

- Your disk space residing MySQL data is full. Clean the disk and restart.

Hope this helps.

mgm_03

3:19 am on Aug 17, 2005 (gmt 0)

10+ Year Member



thanks for the replies....I am on a shared webserver. The hosting company has control of server settings. *sigh*

dreamcatcher

6:59 am on Aug 17, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Best to get in touch with them. Sounds like someone else`s site is the problem.

dc

jatar_k

7:40 am on Aug 17, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



remember this could also just be you have hit your limit, the number of mysql connections you have on your account is something that is seldom published. Hosts give you large bandwidth but then neglect to mention the minute number of connections they allow to your account that allows 10 seperate dbs.

I have had this problem before and promptly changed hosts. I am not saying that is what you need to do, that is just what happened in my particular case.