mysql_tuning
This is an old revision of the document!
Warning: Undefined variable $state in /usr/share/nginx/html/lib/plugins/tabinclude/helper.php on line 130
Warning: Undefined variable $html in /usr/share/nginx/html/lib/plugins/tabinclude/helper.php on line 240
Warning: Undefined array key "page" in /usr/share/nginx/html/lib/plugins/tabinclude/helper.php on line 265
Warning: Undefined array key "page" in /usr/share/nginx/html/lib/plugins/tabinclude/helper.php on line 268
Mysql Tuning
- Max Connections
- caching - Page not found.
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 /etc/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 /etc/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 |
Setting max user connections
1 |
mysql -e 'show variables;' | grep -i max_user_connections |
1 |
show variables like 'max_user_connections' ; |
mysql_tuning.1428478317.txt.gz · Last modified: 2024/05/23 07:26 (external edit)