默認(rèn)是100
需要修改為1000
查看連接數(shù)
SHOW VARIABLES LIKE 'max_connections';
找到mysqld啟動的那兩行,在后面加上參數(shù) :
-O max_connections=1000
(大概在300多行左右),可搜索關(guān)鍵詞 if test -z "$args"
if test -z "$args"
then
$NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file --skip-external-locking -O max_connections=1000 >> $err_log 2>&1
else
eval "$NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file --skip-external-locking $args -O max_connections=1000 >> $err_log 2>&1"
fi
或者修改 my.cnf
在最后添加如下代碼
[mysqld]
set-variable=max_connections=1000
查看Mysql連接數(shù)
mysqladmin -uroot -p processlist
show full processlist;