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ù)庫賬號的密碼后可看到

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

還有一種方法,

修改原代碼:

解開MySQL的原代碼,進入里面的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},

存盤退出,然后./configure ;make;make install可以獲得同樣的效果。

分享到

wangyao

相關(guān)推薦