User Tools

Site Tools


mysql_maxconnections

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
mysql_maxconnections [2015/04/07 07:48] luke7858mysql_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;' | grep max_connections mysql -e 'show variables;' | grep max_connections
 +</sxh>
 +OR if you log into mysql you can use the following command:
 +<sxh bash>
 +show variables like 'max_connections';
 </sxh> </sxh>
 You should have a similar output: You should have a similar output:
Line 8: Line 12:
 </sxh> </sxh>
 \\ \\
-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 21: 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
 +</sxh>
 +\\
 +---------------------------------------------------------------
 +\\
 +=== Setting max user connections ===
 +<sxh bash>
 +mysql -e 'show variables;' | grep -i max_user_connections
 +</sxh>
 +\\
 +<sxh bash>
 +show variables like 'max_user_connections';
 </sxh> </sxh>
mysql_maxconnections.1428392895.txt.gz · Last modified: 2024/05/23 07:26 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki