国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 數(shù)據(jù)庫(kù) > MySQL > 正文

修改Linux下mysql 5.0.xx默認(rèn)連接數(shù)

2024-07-24 12:55:59
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
  • 網(wǎng)站運(yùn)營(yíng)seo文章大全
  • 提供全面的站長(zhǎng)運(yùn)營(yíng)經(jīng)驗(yàn)及seo技術(shù)!
  •   這段時(shí)間服務(wù)器崩潰2次,一直沒(méi)有找到原因,今天看到論壇發(fā)出的錯(cuò)誤信息郵件,想起可能是mysql的默認(rèn)連接數(shù)引起的問(wèn)題,一查果然,老天,默認(rèn)連接數(shù)才100, 怎么夠呀,在網(wǎng)上找了半天資料,有說(shuō)修改my.cnf的,有說(shuō)修改safe_mysqld,試了,前者無(wú)用,后者文件找不到:)原來(lái)是以前的版本跟現(xiàn)在的版本有所不同。

      言歸正傳。我以centos 4.4 下面的mysql 5.0.33 手工編譯版本為例說(shuō)明:

      vi /usr/local/mysql/bin/mysqld_safe

      找到safe_mysqld編輯它,找到mysqld啟動(dòng)的那兩行,在后面加上參數(shù) :

      -o max_connections=1500

      具體一點(diǎn)就是下面的位置:

      用紅字特別說(shuō)明:

    then $nohup_niceness $ledir/$mysqld
    $defaults --basedir=$my_basedir_version
    --datadir=$datadir $user_option
    --pid-file=$pid_file
    --skip-external-locking
    -o max_connections=1500
    >> $err_log 2>&1 else
    eval "$nohup_niceness $ledir/$mysqld
    $defaults --basedir=$my_basedir_version
    --datadir=$datadir $user_option
    --pid-file=$pid_file
    --skip-external-locking $args
    -o max_connections=1500 >>
    $err_log 2>&1"

      保存。

      # service mysqld restart

      # /usr/local/mysql/bin/mysqladmin -uroot -p variables

      輸入root數(shù)據(jù)庫(kù)賬號(hào)的密碼后可看到

      max_connections 1500 即新改動(dòng)已經(jīng)生效。

      還有一種方法,

      修改原代碼:

      解開(kāi)mysql的原代碼,進(jìn)入里面的sql目錄修改mysqld.cc找到下面一行:

    {"max_connections", opt_max_connections,
    "the number of simultaneous clients allowed.", (gptr*) &max_connections,
    (gptr*) &max_connections, 0, get_ulong, required_arg, 100, 1, 16384, 0, 1,
    0},

      把它改為:

    {"max_connections", opt_max_connections,
    "the number of simultaneous clients allowed.", (gptr*) &max_connections,
    (gptr*) &max_connections, 0, get_ulong, required_arg, 1500, 1, 16384, 0, 1,
    0},

      存盤(pán)退出,然后./configure ;make;make install可以獲得同樣的效果

    發(fā)表評(píng)論 共有條評(píng)論
    用戶名: 密碼:
    驗(yàn)證碼: 匿名發(fā)表
    主站蜘蛛池模板: 晋城| 武穴市| 基隆市| 阜康市| 东方市| 灵石县| 固始县| 景东| 营口市| 西昌市| 维西| 綦江县| 太康县| 平谷区| 宾阳县| 肇庆市| 体育| 会东县| 米易县| 松原市| 蒙自县| 定陶县| 米泉市| 丰县| 德清县| 习水县| 嘉峪关市| 铜梁县| 泸水县| 乐至县| 汉寿县| 鄂州市| 筠连县| 大渡口区| 水富县| 丹阳市| 陇川县| 丹凤县| 历史| 长武县| 车险|