Home > Article > Backend Development > Increase the maximum number of connections for MySql_PHP tutorial
MAX QUERIES PER HOUR --- Maximum number of queries per hour
MAX UPDATES PER HOUR --- Maximum number of updates per hour
MAX CONNECTIONS PER HOUR --- Maximum number of connections per hour
under Win You can modify my.ini:
4.0 and below, insert
set-variable=max_connections=1000 (or more) under [mysqld].
Modify the attribute of max_connections in version 4.1 or above
max_connections=1000 (or more).
Under Unix/Linux:
The default maximum number of connections for mysql is 100. This value is far from enough for database applications with many concurrent connections. You can increase it appropriately
whereis safe_mysqld
Find the location of safe_mysqld, then edit it, find the two lines where mysqld is started, and add the parameters
-O max_connections=1000
for example
--- safe_mysqld.orig Mon Sep 25 09:34: 01 2000
+++ safe_mysqld Sun Sep 24 16:56:46 2000
@@ -109,10 +109,10 @@
if test "$#" -eq 0
then
nohup $ledir/mysqld --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR
- --skip-locking >> $err_log 2>&1
+ --skip-locking -O max_connections= 1000 >> $err_log 2>&1
else
nohup $ledir/mysqld --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR
- --skip-locking "$@" >> ; $err_log 2>&1
+ --skip-locking "$@" -O max_connections=1000 >> $err_log 2>&1
fi
if test ! -f $pid_file # This is removed if normal shutdown
then
Then close mysql and restart it, use
/mysqladmin path/mysqladmin -uroot -p variables
After entering the password of the root database account, you can see
| max_connections | 1000 |
The new changes have taken effect.
Note:
In mysql version 4.07, in lines 274 and 276 of the safe_mysqld file