iT邦幫忙

0

[MySQL] Host is blocked because of many connection errors

Fetal error: Host 'xxx.com' is blocked because of many connection errors;
unblock with 'mysqladmin flush-hosts'

我是使用 mysql_connect 連結 db,平時大約 900 人上線(by Google Analytics)
每過一段時間就會出現這個訊息,爬了一下文章
看到一篇是教調大 max_connect_errors
但還是不時還會出現這個狀況

訊息內容是指出有太多錯誤連線導致 mysql lock
我記得 mysql_connect過一段時間會自動釋放 connection
照理說應該 error connection 也會釋放才對
為什麼一卡就是無解了,非得下指令 flush 才行

若觀念錯誤請指正

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

6
wiseguy
iT邦超人 1 級 ‧ 2011-09-09 17:51:42
最佳解答

請編輯 my.cnf 調整 max_connections 為 1200 左右,並把 wait_timeout 降為 1000:

<pre class="c" name="code">max_connections = 1200
wait_timeout = 1000

改完重跑 mysql

chan15 iT邦新手 3 級 ‧ 2011-09-09 18:23:53 檢舉

目前看到的設定如下
max_connections 3000
max_connect_errors 10
wait_timeout 28800

我要發表回答

立即登入回答