Jump to content

Too many connections


mailtome

Recommended Posts

Hi
I am getting the following error
PHP Warning: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Too many connections in /usr/share/pear/adodb/drivers/adodb-mysql.inc.php on line 340

Can anyone tell me the possible reasons for this
Link to comment
Share on other sites

you have reached the maximum number of concurrent connections to your mysql database.

Are you using mysql_pconnect() or mysql_connect() ?

I was using pconnect for a long time, and couldnt figure out the reason why it kept maxing out. Turned out every database conection stayed open and kept adding new connections on top.
Link to comment
Share on other sites

[!--quoteo(post=368310:date=Apr 25 2006, 02:39 AM:name=wisewood)--][div class=\'quotetop\']QUOTE(wisewood @ Apr 25 2006, 02:39 AM) [snapback]368310[/snapback][/div][div class=\'quotemain\'][!--quotec--]
you have reached the maximum number of concurrent connections to your mysql database.

Are you using mysql_pconnect() or mysql_connect() ?

I was using pconnect for a long time, and couldnt figure out the reason why it kept maxing out. Turned out every database conection stayed open and kept adding new connections on top.
[/quote]
I am using mysql_connect
Link to comment
Share on other sites

I cant remember where it is now, but there is a mysql ini file with a setting for max concurrent connections, simply increase that to the maximum connections you might require.

However, if you're not having many users online at once at the moment (less than 20 for example) and you're not using mysql_pconnect i see no reason why this should be max'ing your connections.

Link to comment
Share on other sites

I close the connections when ever I open them. But I think that should not matter because I am using mysql_connect. This is from PHP documentation
[b]Using mysql_close() isn't usually necessary, as non-persistent open links are automatically closed at the end of the script's execution.[/b]
Link to comment
Share on other sites

I can only suggest finding out what the current max connections is set to, and how many connections you have running.

In phpmyadmin you can find out what connections there are by doing the following;

From the main page choose "show processes"
This will display all active connections.

At present mine shows two connections, and we have 7 users currently online, each with an automatic query running every 60 seconds.

Link to comment
Share on other sites

exactly. Still dont understand how you've got max connections on if you're not letting anyone use the script except yourself and you're not using pconnect though.

Is this a local install or is it on an ISP installation? Have you used this before for other projects?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.