绿色资源网

电脑版
提示:原网页已由神马搜索转码, 内容由www.downcc.com提供.
您的位置:首页数据库类MySQL→ 加大mysql的最大连接数

加大mysql的最大连接数

我要评论2009/04/15 16:05:49 来源:绿色资源网编辑:编辑整理 评论:0点击:327次

mysql的最大连接数默认是100, 这个数值对于并发连接很多的数据库应用是远远不够的,可以把它适当调大, whereis safe_mysqld 找到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 | 
即新改动已经生效。

关键词:mysql

相关阅读

阅读本文后您有什么感想? 已有 人给出评价!

  • 1

  • 1

  • 1

  • 1

  • 1

  • 1

用户评论

热门评论

最新评论

发表评论查看所有评论(0)

昵称:
请不要评论无意义或脏话,我们所有评论会有人工审核.
字数: 0/500(您的评论需要经过审核才能显示)

相关软件

热点图文

更多+

精品软件