How to adjust the maximum number of connections in MYSQL
This article shows you how to adjust the maximum number of connections in MYSQL. The content is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
How to increase the maximum number of connections in MYSQL
1. Modify safe_mysqld
Find safe_mysqld and edit it, find the two lines where mysqld starts, and add parameters at the end:
-Omax_connections=1000
For example: (the content preceded by-- is the original content, while + is modified)
-safe_mysqld.origMonSep2509:34:012000
+ safe_mysqldSunSep2416:56:462000
@ @-109, 109, 109, 10, 10, 10, 10, 10, 10, 10.
Iftest "$#"-eq0
Then
Nohup$ledir/mysqld--basedir=$MY_BASEDIR_VERSION--datadir=$DATADIR
-skip-locking > > $err_log2 > & 1
+-- skip-locking-Omax_connections=1000 > > $err_log2 > & 1
Else
Nohup$ledir/mysqld--basedir=$MY_BASEDIR_VERSION--datadir=$DATADIR
-skip-locking "$@" > > $err_log2 > & 1
+-- skip-locking "$@"-Omax_connections=1000 > > $err_log2 > & 1
Fi
Iftestworthy Mushroom words piddling fileholders Thisisremovedifmovie shutdown
Then
Then close mysql and restart it, using the
/ path where mysqladmin is located / mysqladmin-uroot-pvariables
After entering the password of the root database account, you can see
| | max_connections | 1000 | |
That is, the new changes have come into effect.
How to increase the maximum number of connections in MYSQL
two。 Modify the original code
Unlock the original code of MySQL, enter the sql directory inside and modify mysqld.cc to find the following line:
{"max_connections", (long*) & max_connections,100,1,16384,0,1}
Change it to:
{"max_connections", (long*) & max_connections,1000,1,16384,0,1}
Save and exit, and then. / configure;make;makeinstall can get the same effect.
The above is how to adjust the maximum number of connections in MYSQL. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.