Skip to site navigation

Web Hosting - Linux: MySQL Connection Failed: Too many...

Expand / Collapse
 

Web Hosting - Linux: MySQL Connection Failed: Too many connections


Aim of this article

This article will attempt to explain this MySQL error on your Linux (cPanel) service. Please be aware that this is for information purposes only, Zen are unable to support coding issues.

MySQL Connection Limitations

In order to maintain a stable hosting platform it is necessary to place some limitations on MySQL database connections. If users were permitted to make connection after connection to the MySQL server they would eventually use up too large a portion of the server's resources making it unstable. For this reason the total number of connections allowed globally and per user are restricted.

With this restriction comes the possibility that some sites might produce the Too many connections error. Usually this is due to inefficient coding which allows MySQL connections to remain open after they have been used. This ties up server resources.

Resolution

Possibly the most common and easiest way to resolve this problem is use mysql_connect rather than mysql_pconnect and be sure to close the connection with mysql_close.

mysql_pconnect creates a persistent connection to the MySQL server. See Persistent Database Connections for more detailed information.

Customer's may benefit from reading up on this error.

MySQL Documentation too many connections

Google Search mysql too many connections

Further Resources

Customer's can find further information on MySQL and PHP from their relevant websites:

http://www.php.net/

http://www.mysql.com/



Rate this Article:
     

Feedback on this Article


Name: *
Email Address:
Web Address:
   
  
 
 
   
CAPTCHA
Speak the CAPTCHA code Change the CAPTCHA code
 
Type the characters:Required
 

Details
Type: TROUBLESHOOTING
Rated 1 star based on 1 vote
Article has been viewed 763 times.
Options

Skip to site navigation