免费注册 查看新帖 |

Chinaunix

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

高手请进,最大连接数问题,急,在线等 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-03-26 02:38 |只看该作者 |倒序浏览
我的系统是Redhat7.3+Apache2.0.44+PHP4.3+MYSQL3.23.55
由于MYSQL的系统默认最大连接是100,我想改为1000,得不知道要如何改。在网上搜索资料如下(下面是原文):


找到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 |
即新改动已经生效。

不过可能是由于版本的问题,我没有找到上面相似的语句,我找到如下的语句:
  if test -z "$args"
  then
    echo "mytest1"
    $NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file --skip-locking >;>; $err_log 2>;&1
  else
    echo "mytest2"
    eval "$NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file --skip-locking $args >;>; $err_log 2>;&1"
  fi
  if test ! -f $pid_file                # This is removed if normal shutdown
  then
    break
  fi

我改为
  if test -z "$args"
  then
    echo "mytest1"
    $NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file --skip-locking -O max_connections=1000 >;>; $err_log 2>;&1
  else
    echo "mytest2"
    eval "$NOHUP_NICENESS $ledir/$MYSQLD $defaults --basedir=$MY_BASEDIR_VERSION --datadir=$DATADIR $USER_OPTION --pid-file=$pid_file --skip-locking $args -O max_connections=1000 >;>; $err_log 2>;&1"
  fi
  if test ! -f $pid_file                # This is removed if normal shutdown
  then
    break
  fi
但结果还是不行,

请高手指教,我应该如何改???谢谢!·

论坛徽章:
0
2 [报告]
发表于 2003-03-26 08:37 |只看该作者

高手请进,最大连接数问题,急,在线等

改这个干嘛?改/etc/my.cnf,加上参数。

论坛徽章:
0
3 [报告]
发表于 2003-03-28 00:44 |只看该作者

高手请进,最大连接数问题,急,在线等

谢谢我试试。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP