mysql_maxconnections
This is an old revision of the document!
You are able to view the max connections for mysql with the following command:
1 |
mysql -e 'show variables;' | grep max_connections |
1 |
show variables like 'max_connections' |
1 |
max_connections 151 |
There are two options to set the max connections for mysql, you can edit the setting in mysql (which is not permanent) and you can edit the variable in the /etc/my.cnf file which will be permenant (when service is restarted the variable is still in place).
Option 1
You can use the following command from your shell (you do not need to log directly into mysql for this if your .my.cnf file has been configured).
1 |
mysql -e 'set global max_connections = 200;' |
1 |
mysql -e 'show variables;' | grep max_connections |
Option 2
Edit the .my.cnf file with the new variable settings for them to be permanent. Add the following code to the file:
1 2 |
[mysqld] max_connections = 1000 |
mysql_maxconnections.1428395057.txt.gz · Last modified: 2024/05/23 07:26 (external edit)