There are two ways to increase MySQL connections. Here’s the command to update max connections to 200 via MySQL command line tool without restart.
mysql> set global max_connections = 200;
The above command will increase max connections without restart but once the server is restarted, the changes will be gone. This method is useful to increase available connections in a production system such as a website/app, without having to restart your database server.
To permanently increase max connections, open my.cnf file,
$ sudo vi /etc/my.cnf
Depending on your Linux distribution and type of installation, my.cnf file may be located at any of the following locations.
/etc/my.cnf
/etc/mysql/my.cnf
$MYSQL_HOME/my.cnf
~/.my.cnf
Add the following line under [mysqld] section.
max_connections = 200
Now if you restart MySQL server, the changes will persist.
Restart MySQL Server
Restart MySQL Server to apply changes
$ sudo service mysql restart
Hopefully, the above tutorial will help you increase max connections in MySQL.