InMotion Hosting Support Center

getting too many connections errors (Mysql)

Category: Website

2013-02-27 12:44 pm EST

Hits: 2,193
I have two heavily Mysql-driven websites ( and and I'm running into this error all morning:

Warning: mysql_pconnect() [function.mysql-pconnect]: Too many connections in /home/newjer13/public_html/ on line 7
Unable to select database

What can I do to prevent this? I've just started promoting my websites, so traffic is going up. Is this a coding issue or could I possibly be hitting the maximum number of users at one time?

The sites have been working fine for years. These errors are just popping up now.

You must login before you can ask a follow up question.

You must login before you can submit an answer.



30,622 Points
2013-02-27 5:17 pm EST
Hello newjerseystage,

Thank you for your question. As per your warning, you are using pconnect:

It is not recommended to use persistent mysql connections, because it allows one visitor to make multiple connections.

With a regular connect, it will process the connection, then close the connection once it finishes.

Here is a link to an article here in our support center that explains persistent connections in better detail.

It is likely that bots are crawling your websites, which is normal, and each time they hit a page, it makes a connection. With pconnect it does not close the previous connection, so when a bot hits every page without disconnecting it can use up your connections.

If you have any further questions, feel free to post them below, or contact live Tech Support.

They are available 24/7 via:
Phone: 888-321-HOST (4678)
757-416-6575 (Intl.)
Chat (there is a link on the top right).

Thank you,


You must login before you can post a comment about this answer.

Like this Question?

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!