Increase MySQL connection limit

mysql> show variables like "max_connections";

+-----------------+-------+

| Variable_name | Value |

+-----------------+-------+

| max_connections | 151 |

+-----------------+-------+

1 row in set (0.00 sec)

You can increase the setting by issuing the following command without restart MySQL server. Note that the change will take effect immediately but the change is not permanent and will be forgotten after MySQL restart.

mysql> set global max_connections = 200;

If you want to set it permanently do the following thing:

Add max_connections parameter under the [mysqld] section

# vi /etc/my.cnf

max_connections = 250

Restart MySQL after the changes. The setting will take effect after restart MySQL.

Note: Consider to increase the max_connections setting with caution if you increase the session since increase the number of connection may require RAM to run MySQL.