Question
How do I modify MySQL's max_connections setting?
Answer
The default max_connections setting for MySQL is 151. Here is how to modify it:
- Access the server's command line as the 'root' user via SSH or Terminal in WHM.
Check the current
max_connectionssetting:# mysql -e "show variables like 'max_connections';"
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 151 |
+-----------------+-------+- Open
/etc/my.cnfin your preferred text editor. Locate the
max_connectionsentry or add the entry to the end of the file if one doesn't exist.CONFIG_TEXT: max_connections=151
- Set the
max_connectionsvalue 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_connectionssetting has been updated:# mysql -e "show variables like 'max_connections';"
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 200 |
+-----------------+-------+
Comments
0 comments
Article is closed for comments.