找到safe_mysqld的位置,然后编辑它,找到mysqld启动的那两行,在后面加上参数
-O max_connections=1000
例如
--- 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
这个办法有问题,设置后不起作用,下面的方法可以:
找到my.ini(在windows\下,没有就在mysql\下找)
打开它
[mysqld]
set-variable = max_connections=16384
其中max_connections=16384就是.