How to check the max_connections in MySQL database.

rpaco@choi:~$mysql -uroot -h localhost -p
Enter Password: mypassword

Type the command below.
mysql> show variables like ‘max_connections’;
+—————–+——-+
| Variable_name   | Value |
+—————–+——-+
| max_connections | 100   |
+—————–+——-+

Set temporary values. This values will be reset when mysql service restart.

mysql>set global max_connections = 200;

To set it permanently.

vi /etc/mysql/my.cnf
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address            = 127.0.0.1
#
# * Fine Tuning
#
key_buffer              = 16M
max_allowed_packet      = 16M
thread_stack            = 128K
thread_cache_size       = 8
max_connections        = 250    <— uncommented then I have changed the value to 250

Leave a Reply