mysql_maxconnections
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
mysql_maxconnections [2015/04/07 07:46] – created luke7858 | mysql_maxconnections [2024/05/23 07:26] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 2: | Line 2: | ||
<sxh bash> | <sxh bash> | ||
mysql -e 'show variables;' | mysql -e 'show variables;' | ||
+ | </ | ||
+ | OR if you log into mysql you can use the following command: | ||
+ | <sxh bash> | ||
+ | show variables like ' | ||
</ | </ | ||
You should have a similar output: | You should have a similar output: | ||
Line 8: | Line 12: | ||
</ | </ | ||
\\ | \\ | ||
- | 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 .my.cnf file which will be permenant (when service is restarted the variable is still in place). | + | 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 === | ===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). | + | 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). |
<sxh bash> | <sxh bash> | ||
mysql -e 'set global max_connections = 200;' | mysql -e 'set global max_connections = 200;' | ||
Line 20: | Line 25: | ||
\\ | \\ | ||
=== Option 2 === | === Option 2 === | ||
- | Edit the .my.cnf file with the new variable settings for them to be permanent. Add the following code to the file: | + | Edit the /etc/my.cnf file with the new variable settings for them to be permanent. Add the following code to the file: |
<sxh bash> | <sxh bash> | ||
[mysqld] | [mysqld] | ||
max_connections = 1000 | max_connections = 1000 | ||
+ | </ | ||
+ | \\ | ||
+ | --------------------------------------------------------------- | ||
+ | \\ | ||
+ | === Setting max user connections === | ||
+ | <sxh bash> | ||
+ | mysql -e 'show variables;' | ||
+ | </ | ||
+ | \\ | ||
+ | <sxh bash> | ||
+ | show variables like ' | ||
</ | </ |
mysql_maxconnections.1428392819.txt.gz · Last modified: 2024/05/23 07:26 (external edit)