Store
Community Documentation

v3 Knowledgebase

How to Increase MySQL connection limit, error too many connections

If you are getting the error:

Too many connections or User XXXXXX already has more than 'max_user_connections' active connections.

Here is the solution:

MySQL's default configuration sets the maximum simultaneous connections to 100.

If you need to increase it, you can do it fairly easily:

For MySQL 3.x:

# vi /etc/my.cnf
set-variable = max_connections = 250

For MySQL 4.x and 5.x:

# vi /etc/my.cnf
max_connections = 250

Restart MySQL once you've made the changes and verify with:

echo "show variables like 'max_connections';" | mysql

More information here:

* http://dev.mysql.com/doc/refman/5.5/en/too-many-connections.html

Other solution by t3ln3t

Quote:


This can also be done on a live database ... I performed the same task, as follows:

mysql> use phpfox;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show variables like "max_connections";
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 100 |
+-----------------+-------+
1 row in set (0.00 sec)

mysql> set global max_connections = 200;
Query OK, 0 rows affected (0.00 sec)

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

So ... first I checked the value of max_connection. Then I changed the value. Then I re-checked to make sure the value I changed, has been changed.