Subscribe Newsletter

Your Name  : 
Email Address *  : 
  • Online: Get Electricity Bill Now on Mobile and Email | Bala-Krishna
  • webs.com: com and type in the IP address you want to convert into its decimal url,...
  • PNR Status: check multiple pnr status with a single click PNR Status
  • Click here: Cheers for the informative blog post, I truly appreciated it. I would...
  • Leela: Only site on web which allows checking of Multiple Train PNR Status with a...
  • PUNEET: getting authentication error in digsby while opening yahoo email accounts,...
  • Arvind Pandit: Search your bank SWIFT code online | Bala-Krishna
  • pokemon: Wordpress WP_Categories doesn?t exist Error Fix | Bala-Krishna
  • Jambula Hanmanth Reddy: SIR/MADAM, I have forgot my username,password,and...
  • Jitendrakumar: This is working Perfectly. Thanks Buddy
  • ashfaq: nice post it well me lot no 1 has solution for this problem
  • irctc pnr status: This is useful information to know the pnr status. Thanks for...
  • Maria: How? How do you change the Digsby default yahoo server to the new one?...
  • Archives

  • Blog Stats

MySQL Too Many Connections Error Problem & Fix

If you are getting? Too many connections error when you try to open your website in browser, It means all available connection used by other script or mysql process. Number of connection to mysql server determined by setting in mysql conf? file.? By default,? it is 151? for MySQL 5.x and 100 for MySQL 4.x.? To change setting, open mysql conf file. In Linux it can be found (/etc/my.cnf) and in windows within installation folder. Find max_connections setting under [mysqld] section. This setting must be within [mysqld] section. Change setting which is suitable to you.

[mysqld]
max_connections=200

There are several reason that cause server to raise this error:

Persistent Connections: This is common cause of this error. If script uses persisit connection and script does? not close connection even if script terminates. To avoid this problem, try using mysql_connect() instead of mysql_pconnect(). Check this setting in third party script such as osCommerce. You can turn off this setting in php.ini file. Script using persist connection will use non-persistent connection without any warning or error if persistence connection disabled.

Server administrators can disable persistent connections for PHP scripts in php.ini file:

[MySQL]
; Allow or prevent persistent links.
mysql.allow_persistent=Off

Lower MySQL Connect Timeout: Check your mysql connect timeout setting. By default it is 60 seconds and php setting lowering below the dafault setting.

For example: following setting in .htaccess php_value mysql.connect_timeout 25

osCommerce? Setting:

The osCommerce setting mentioned by ?varo is in the catalog/includes/configure.php file:

define(‘USE_PCONNECT’, ‘false’); // use persistent connections?

It defaults to true, so mysql_pconnect() is used, and you get the error message “Warning: mysql_pconnect(): Too many connections …” Change to false for mysql_connect() to be used.


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

One Response to “MySQL Too Many Connections Error Problem & Fix”

  1. Good post and just a small update on your post after we increase the “max_connections” we need to restart our MYSQL server in order to reflect our changes.

Leave a Reply