Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[function.mysql-pconnect]: User xxxxxx_osc1 has already more than 'max_user_connections' active connections?


staradmire

Recommended Posts

Posted

I have this strange error that keeps popping up every now and then on my site. Can someone Please help me to what it is and how and where I might fix it?

 

Warning: mysql_pconnect() [function.mysql-pconnect]: User xxxxxx_osc1 has already more than 'max_user_connections' active connections in /home/xxxxx/public_html/store/includes/functions/database.php on line 17

Unable to connect to database server!

Posted

Has your host limited the amount of connections allowed to your database to something rediculously low?

 

Rob

Rob Bell - Inspired Graphix

Customising osCommerce in Australia, and the world!

View my profile for web and email links.

 

I'm sorry, but i cannot offer Free support via PM etc, and osCommerce forums prohibit me from putting any reference to paid support in my signauture.

However viewing my profile may provide links to my website or something like that which you may find useful.

Posted

All hosts set a limit on the number of mysql connections allowed at the same time. This is set in the httpd.conf file - which you won't have access to on a shared host.

 

However, you can make things worse for yourself if you have done what a lot of inexperienced people do and that is to enable 'Persistent Connections' (use_pconnect) in both configure.php files. This should be set to false.

 

Vger

Posted
All hosts set a limit on the number of mysql connections allowed at the same time. This is set in the httpd.conf file - which you won't have access to on a shared host.

 

However, you can make things worse for yourself if you have done what a lot of inexperienced people do and that is to enable 'Persistent Connections' (use_pconnect) in both configure.php files. This should be set to false.

 

Vger

 

 

Thank you for answering. More then likely the host limited mysql connections. I didnt touch the config files for the pconnect. I actually do my own webhosting and have a few sites under our host name. We are still pretty new at it. The one I am working on is one of them. I have never had a problem with the database before limiting connections. Anyone know how to update that? I will contact who I have my hosting under as well have them up the connections. If I can find out how. thank you.

  • 7 months later...
Posted

Hi all,

since 2 weeks I have got the same problem on my website, I get this error msg:

Warning: mysql_connect() [function.mysql-connect]: User quartomo19349 already has more than 'max_user_connections' active connections in /home/mhd-01/www.quartomotoricambi.it/htdocs/catalog/admin/includes/functions/database.php on line 19

Unable to connect to database server!

I really don't understand why!!!

Somebody can help me?

Thanks

  • 2 weeks later...
Posted
already has more than 'max_user_connections' active connections in ... on line 19

Unable to connect to database server![/i][/u]

 

I often get the same error message for the last 2 weeks. My hosting company (superb.net) has blamed Oscommerce for having bad code. Could someone please explain the answer my hosting company gave?

 

This is what they say:

 

But the application you used for your website is in a bad design.

 

All pages, images are generated by scripts, especially the images.

And you are using session_start() on all those pages.

 

So if you load the front page all images in that pages will be loaded at the same time. And the session_start() function will be called at the same time. session_start() needs to lock a file, write info into the file and then unlock it. So they are waiting for the lock to be released.

 

To test it, I write a script:

 

/catalog/ying.php

 

It's nearly the same as includes/application_top.php.

I just added two print and move the function tep_session_start(); to this file.

 

If you want the page slow, just open two IE windows.

In the first window, you access to the page:

 

When it's loading, please click on the REFRESH icon several times to make it slow.

 

At the same time, in the other page, you access to the page:

/catalog/ying.php

 

It will print something like:

Time used before session_start: 1

Time used after session_start: 22

 

So the session_start() function used 21 seconds!

 

To get the result, I freshed the http://www.myhomepage.com page five times(dont' wait, just click the refresh icon five times). and then switch to another window, reload /catalog/ying.php.

 

Please redesign your system otherwise you will experience this slow loading.

Posted
I often get the same error message for the last 2 weeks. My hosting company (superb.net) has blamed Oscommerce for having bad code. Could someone please explain the answer my hosting company gave?

 

This is what they say:

Actually, I don't have a clue about why tep_session_start would take that much time. You did read Vger's remark about not using persistent connections above did you?

 

The (IMHO) smartest thing to do is reduce the number of queries needed, so you don't get the error. I suggest trying (if you can use it with your code for the categories box...) the Optimize categories box contribution. At the bottom of the instructions there is a link to the tax class optimization by Chemo which also is very helpful in reducing the number of queries.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...