bizbot Posted February 14, 2007 Posted February 14, 2007 (edited) 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. The website works but if you use it for awhile - I get this error message on all the webpages: 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 User success_DNPage has already more than 'max_user_connections' active connections There is a link in the error message and when you click on it says: 404 If you wait a few minutes the website works again but only for awhile then you get the error message again. Can somebody help? Do you need more info? Thanks Edited February 14, 2007 by bizbot Quote
TCH-Andy Posted February 14, 2007 Posted February 14, 2007 Welcome to the forums bizbot I'd suggest changing the mysql_pconnect to mysql_connect (without the p) in the code. Quote
bizbot Posted February 15, 2007 Author Posted February 15, 2007 Welcome to the forums bizbot Thanks for the welcome! I have been a customer since 2003 - (I have been lurking at the forum since signing up). I will try the fix. It only does it after you add or delete an item from the admin page. Quote
bizbot Posted February 16, 2007 Author Posted February 16, 2007 (edited) Andy, I had a programmer look at the site and he said the following: I don't think the solution is to just change the connection type. mysql_pconnect() is OK, as it uses persistent connections, so a separate Mysql connection is not needed to be created for every page. From the error on your page "User success_DNPage has already more than 'max_user_connections' active connections" it looks like that is exactly the problem on your site. There are not enough available connections, so switching to mysql_connect() would make matters even worse. The solution here is to ask your host or your system admin to tweak the Mysql config file, and especially increase the value for these 2: "max_connections" and "max_user_connections". Does this seem correct and do I need to open a support ticket? Thanks! Edited February 16, 2007 by bizbot Quote
TCH-Andy Posted February 16, 2007 Posted February 16, 2007 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. Is there any specific reason your programmer wants to use persistent connections ? Quote
bizbot Posted February 17, 2007 Author Posted February 17, 2007 (edited) Fixed the code and the site is working. Thanks Andy! I bought "PHP & MySQL for Dummies" today on my way home. Edited February 17, 2007 by bizbot Quote
TCH-Andy Posted February 17, 2007 Posted February 17, 2007 You're welcome I'm glad it's fixed 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. Quote
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.