出现Too many connections错误,怎样解决?
生活随笔
收集整理的這篇文章主要介紹了
出现Too many connections错误,怎样解决?
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
怎樣增加mysql的max_connections,mysql連接數默認是100, 這個數值對于并發連接很多的數據庫應用是不夠的,可是怎樣把它適當調大呢?
找到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
這個辦法有問題,設置后不起作用,下面的方法可以:
找到my.ini(在windows\下,沒有就在mysql\下找)
打開它
[mysqld]
set-variable? ? = max_connections=16384
其中max_connections=16384就是.
找到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
這個辦法有問題,設置后不起作用,下面的方法可以:
找到my.ini(在windows\下,沒有就在mysql\下找)
打開它
[mysqld]
set-variable? ? = max_connections=16384
其中max_connections=16384就是.
轉載于:https://www.cnblogs.com/loyou/archive/2007/03/06/665978.html
總結
以上是生活随笔為你收集整理的出现Too many connections错误,怎样解决?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: atlas和ajaxpro以及微软企业级
- 下一篇: 微软Windows SharePoint