加大mysql的最大連接數
mysql的最大連(lián)接數默認(rèn)是100, 這個數值對於並發連接很多的數據(jù)庫應用是遠遠不夠的,可以把它(tā)適當調大, whereis safe_mysqld 找到(dào)safe_mysqld的(de)位置,然(rán)後編輯它(tā),找到mysqld啟動的那兩行,在後麵加(jiā)上(shàng)參數 -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
然後(hòu)關(guān)閉(bì)mysql重啟它,用 /mysqladmin所在路徑/mysqladmin -uroot -p variables
輸入(rù)root數據庫(kù)賬號(hào)的密碼後可看到 | max_connections | 1000 |
即新改動(dòng)已經生效。
關鍵詞:mysql
閱讀本文後您有什麽感想(xiǎng)? 已有(yǒu) 人給出評價!
- 1
- 1
- 1
- 1
- 1
- 1