Mysql Warning & Bug

liunx

Guest
I have a webpage in php - you can add or delete items for sale from the admin page. I have never had any problems with it before but I recently added and deleted some items. <br /><br />The website works but if you use it for awhile - I get this error message on all the webpages:<br /><br />Warning: mysql_pconnect() [function.mysql-pconnect]: User success_DNPage has already more than 'max_user_connections' active connections in /home/success/public_html/draft/Connections/domains.php on line 10<br />User success_DNPage has already more than 'max_user_connections' active connections<br /><br />There is a link in the error message and when you click on it says: 404<br /><br />If you wait a few minutes the website works again but only for awhile then you get the error message again.<br /><br />Can somebody help? Do you need more info?<br /><br />Thanks<!--content-->
Welcome to the forums bizbot <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> <br /><br />I'd suggest changing the mysql_pconnect to mysql_connect (without the p) in the code.<!--content-->
Welcome to the forums bizbot <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
<!--quoteo(post=200522:date=Feb 14 2007, 07:01 PM:name=TCH-Bruce)--><div class='quotetop'>QUOTE(TCH-Bruce @ Feb 14 2007, 07:01 PM) <a href="http://www.totalchoicehosting.com/forums/index.php?act=findpost&pid=200522"><img src='http://www.totalchoicehosting.com/forums/style_images/1/post_snapback.gif' alt='*' border='0' /></a></div><div class='quotemain'><!--quotec-->Welcome to the forums bizbot <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--QuoteEnd--></div><!--QuoteEEnd--><br /><br />Thanks for the welcome! I have been a customer since 2003 - (I have been lurking at the forum since signing up).<br /><br />I will try the fix. It only does it after you add or delete an item from the admin page.<!--content-->
Welcome to the forums bizbot <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
Welcome to the forum, bizbot. <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
Andy, I had a programmer look at the site and he said the following:<br /><br />I don't think the solution is to just change the connection type. mysql_pconnect() <br />is OK, as it uses persistent connections, so a separate Mysql connection is not needed to be<br />created for every page.<br /><br /><br />From the error on your page "User success_DNPage has already more than 'max_user_connections' <br />active connections" it looks like that is exactly the problem on your site.<br />There are not enough available connections, so switching to<br />mysql_connect() would make matters even worse. The solution here is to<br />ask your host or your system admin to tweak the Mysql config file, and<br />especially increase the value for these 2: "max_connections" and<br />"max_user_connections".<br /><br />Does this seem correct and do I need to open a support ticket?<br /><br />Thanks!<!--content-->
Whilst persistent connections eleminate the overheads during creation of new connections, mysql takes relatively short time for creating new connections and often the benefit of using persistent connections is not noticeable. Also, considering the drawbacks of using persistent connections its advantages are negligible. You may have also have to check your code and verify that all mysql sesstions are getting closed after the script execution.<br /><br />Is there any specific reason your programmer wants to use persistent connections ?<!--content-->
Fixed the code and the site is working. Thanks Andy!<br /><br />I bought "PHP & MySQL for Dummies" today on my way home.<!--content-->
You're welcome <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> I'm glad it's fixed <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> <br /><br />If you have further questions, ask away - there is usually someone around who's come across a similar issue before and can offer some suggestions.<!--content-->
 
Back
Top