ERROR 1040 (HY000): Too many connections

ERROR 1040 (HY000): Too many connections

Error:
ERROR 1040 (HY000): Too many connections

Occurred:
Error occurred due to connection reached at maximum limit defined in configuration file of MySQL.

Solution:
Increase the current value of the variable “max_connections”.

Check the current value

mysql> show variables like 'max_connections%';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 1 |
+-----------------+-------+
1 row in set (0.00 sec)

Increase the value of parameter in configuration file or by command:

By Command:
mysql> SET GLOBAL max_connections = 100;
Query OK, 0 rows affected (0.00 sec)

mysql> show variables like 'max_connections%';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 100 |
+-----------------+-------+

By Configuration file:
Edit the configuration file my.cnf.
vi /etc/my.cnf
Find the variable max_connections under mysqld section.
[mysql]
max_connections = 100
Set into higher value and save the file

Note: If you set max_connection = 1, so MySQL will consider maximum allowed 2 connection. Extra One for Super User.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.