vi /usr/bin/mysqld_safe

找到mysqld启动的那两行,在后面加上参数 :

-O max_connections=1000

(大概在300多行左右),可搜索关键词 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

vi /etc/my.cnf

在最后添加如下代码

[mysqld]
set-variable=max_connections=1000

 

查看Mysql连接数

mysqladmin -uroot -p processlist

show full processlist;

相关文章:

  • 2021-07-14
  • 2021-07-19
  • 2021-11-02
  • 2021-12-07
  • 2021-08-20
猜你喜欢
  • 2021-09-22
  • 2022-12-23
  • 2022-12-23
  • 2018-07-08
  • 2021-07-29
  • 2021-10-20
  • 2022-12-23
相关资源
相似解决方案