Introduction
The default max_connections
setting for MySQL is 151
. For some servers, this setting may need adjusting. This article provides the procedure to adjust this setting.
Procedure
- Access the server's command line as the 'root' user via SSH or "Terminal" in WHM.
- Check the current
max_connections
setting.[root@server ~]cPs# mysql -e "show variables like 'max_connections';"
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 151 |
+-----------------+-------+ - Open
/etc/my.cnf
in your preferred text editor. - Locate the
max_connections
entry or add the entry to the end of the file if one doesn't exist.max_connections=151
- Set the
max_connections
value to the desired value. - Save the changes and exit the text editor.
- Restart the MySQL service.
/usr/local/cpanel/scripts/restartsrv_mysql
- Verify that the
max_connections
setting has been updated.[root@server ~]cPs# mysql -e "show variables like 'max_connections';"
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 200 |
+-----------------+-------+
Comments
0 comments
Article is closed for comments.