d-goo supercelldinger

コンピュータ、サーバー関係のいろんな覚え書き それと雑談

MYSQL エラー超過でWEBサーバがDBサーバーに接続拒否された場合

MYSQLエラー接続エラー デフォルト設定10回以上で外部サーバーからの接続を拒否する症状。phpの警告メッセージだと↓こんな恐ろしい状態に

Warning: mysql_connect() [function.mysql-connect]: Host 'wwwxxxxud.sakura.ne.jp' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts' in /home/ore/www/xxxxx.com/html/cn.php on line 8

Warning: mysql_select_db() [function.mysql-select-db]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/ore/www/xxxxx.com/html/cn.php on line 9

Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home/ore/www/xxxxx.com/html/cn.php on line 9

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/ore/www/xxxxx.com/html/cn.php on line 19
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

max_connect_errorsを発生させた外部のhostnameを拒否している状態

【対応】

接続拒否しているDBサーバー側に入ってflush-hosts

[root@mysql]# mysqladmin -u root -p flush-hosts
Enter password: [MYSQLのパスワード] // エンター

これで何もなかった事に・・・