Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

too many connections for mysql: beware of shared hosting upsell


superwebdeveloper

Recommended Posts

Hi,

I am taking care of a OSC store. Monday the site was down. The host had shut off the database access without warning. For some reason, the site was maintaining a lot of open MySQL connections. Lots of them that were chewing up resources on the server. The hosting company was telling me that they would not help me, and wanted to transfer me to sales to get a dedicated server. Talk about getting a hustle!

 

I said no, and my client got further on the phone with the host than I did. I proposed a simple solution, and it worked. At the end of /includes/footer.php, I added one line:

 

mysql_close();

 

PCONNECT was set to false already in configure.php. Mysql is supposed to exit after the page ends. Maybe sometime it wont. We dont know. You can keep control over this issue, which isnt supposed to happen anyways, by adding that command to the end of your footer script. It fixes everything.

Link to comment
Share on other sites

Thank you for that tip. I'm definitely going to try it. I get that message quite a bit.

Just between us, remember there are only 10 kinds of people in the world; those who understand binary and those who don't!!

 

Remember, learning is a "do-it-yourself" experience; although, not necessarily a "do-it-BY-yourself" experience.

 

The quickest way to learn is to forget to BACKUP!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...