免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1354 | 回复: 0
打印 上一主题 下一主题

加大mysql的最大连接数 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-10-21 08:24 |只看该作者 |倒序浏览
加大mysql的最大连接数
mysql的最大连接数默认是100, 这个数值对于并发连接很多的数据库应用是远远不够
的,可以把它适当调大,
whereis safe_mysqld    我的服务器文件在  /usr/local/mysql/bin/safe_mysqld  中
找到safe_mysqld的位置,然后编辑它,找到mysqld启动的那两行,在后面加上参数
[color="#cc3333"]-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 [color="#cc0033"]-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 "$@" [color="#cc0033"]-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 |
即新改动已经生效。

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/4543/showart_52794.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP