mysql并发连接数

本文介绍了如何修改MySQL的默认最大连接数限制,通过编辑my.cnf文件并在[mysqld]部分添加`max_connections=1000`,然后在safe_mysqld启动参数中加入`-Omax_connections=1000`。完成配置后,重启MySQL服务,通过`mysqladmin variables`验证新设置已生效。
摘要由CSDN通过智能技术生成

mysql的最大连接数默认是100,可以把它适当调大
编辑my.cnf
在[mysqld]中加入:
set-variable=max_connections=1000
##得已经cp support-files/my-medium.cnf /etc/my.cnf


找到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
然后关闭mysql重启它,用
/mysqladmin所在路径/mysqladmin -uroot -p variables
输入root数据库账号的密码后可看到
| max_connections | 1000 |
即新改动已经生效。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值