mailtome Posted April 25, 2006 Share Posted April 25, 2006 HiI am getting the following errorPHP 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 340Can anyone tell me the possible reasons for this Quote Link to comment Share on other sites More sharing options...
wisewood Posted April 25, 2006 Share Posted April 25, 2006 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 Link to comment Share on other sites More sharing options...
mailtome Posted April 25, 2006 Author Share Posted April 25, 2006 [!--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 Quote Link to comment Share on other sites More sharing options...
wisewood Posted April 25, 2006 Share Posted April 25, 2006 Do you have a lot of users using the mysql database / your site at the same time? Quote Link to comment Share on other sites More sharing options...
mailtome Posted April 25, 2006 Author Share Posted April 25, 2006 No i dont think so a lot of users will be using it at the same time Quote Link to comment Share on other sites More sharing options...
wisewood Posted April 25, 2006 Share Posted April 25, 2006 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. Quote Link to comment Share on other sites More sharing options...
mailtome Posted April 25, 2006 Author Share Posted April 25, 2006 This is exactly what i want to know Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted April 25, 2006 Share Posted April 25, 2006 Perhaps a simpler option would be to use mysql_close at the end of your scripts and to restart your server - that will kill any connections currently persisting. Quote Link to comment Share on other sites More sharing options...
mailtome Posted April 25, 2006 Author Share Posted April 25, 2006 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] Quote Link to comment Share on other sites More sharing options...
wisewood Posted April 25, 2006 Share Posted April 25, 2006 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. Quote Link to comment Share on other sites More sharing options...
mailtome Posted April 25, 2006 Author Share Posted April 25, 2006 you mean firing SHOW PROCESSLIST query and comparing it with max_connections? Quote Link to comment Share on other sites More sharing options...
wisewood Posted April 25, 2006 Share Posted April 25, 2006 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.