MySQL Too many connections
MySQL too many connections.
Of course this simply means there are too many connections to the MySQL database. This can happen on a very busy site or even on a site with few visitors that contains poor coding that doesn't drop connections.
To fix it, you can go one of two ways. Through SSH using MySQL commands or by adding a directive to the global configuration file (/etc/my.cnf).
For editing the configuration file, simply add the below directive to the configuration file.
Then restart MySQL services:
[01:50:26] [root@localhost ~]# service mysql restart Shutting down MySQL....... [ OK ] Starting MySQL. [ OK ]
To change it via command line, you will need to be root and log into MySQL and use the command "set global max_connections=XXX":
[01:50:37] [root@localhost ~]# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 62 Server version: 5.1.65-cll MySQL Community Server (GPL) Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> set global max_connections=5000; Query OK, 0 rows affected (0.00 sec)