Chinaunix

标题: 高手请进,最大连接数问题,急,在线等 [打印本页]

作者: fxdfbl    时间: 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
但结果还是不行,

请高手指教,我应该如何改???谢谢!·
作者: redfox    时间: 2003-03-26 08:37
标题: 高手请进,最大连接数问题,急,在线等
改这个干嘛?改/etc/my.cnf,加上参数。
作者: fxdfbl    时间: 2003-03-28 00:44
标题: 高手请进,最大连接数问题,急,在线等
谢谢我试试。




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2