Jump to content

Recommended Posts

Posted (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 by bizbot
Posted
Welcome to the forums bizbot :tchrocks:

 

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.

Posted (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 by bizbot
Posted

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 ?

Posted (edited)

Fixed the code and the site is working. Thanks Andy!

 

I bought "PHP & MySQL for Dummies" today on my way home.

Edited by bizbot
Posted

You're welcome :clapping: 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.

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...