Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5708497
  • 博文数量: 675
  • 博客积分: 20301
  • 博客等级: 上将
  • 技术积分: 7671
  • 用 户 组: 普通用户
  • 注册时间: 2005-12-31 16:15
文章分类

全部博文(675)

文章存档

2012年(1)

2011年(20)

2010年(14)

2009年(63)

2008年(118)

2007年(141)

2006年(318)

分类: Mysql/postgreSQL

2006-10-25 14:18:38

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

阅读(3659) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~