views:

256

answers:

2

My app no longer connects to its DB and phpmyadmin says #1129 - Host 'xxx.xx.xx.xx' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

mysql_error() prints out the same message. Could this be because of too many connections?

What causes this?

A: 

From the manual: http://dev.mysql.com/doc/refman/4.1/en/blocked-host.html

The number of interrupted connect requests allowed is determined by the value of the max_connect_errors system variable. After max_connect_errors failed requests, mysqld assumes that something is wrong (for example, that someone is trying to break in), and blocks the host from further connections until you execute a mysqladmin flush-hosts command or issue a FLUSH HOSTS statement. See Section 5.1.3, “Server System Variables”.

You could be having network problems connecting to your database.

Erik
A: 

We had this problem when using monit to monitor our DB server. Monit will cause connection errors if your config is of the form:

if failed port 3306 with timeout 15 seconds 2 times within 3 cycles then alert

Rather than

if failed port 3306 protocol mysql with timeout 15 seconds 2 times within 3 cycles then alert

The lack of 'protocol mysql' causes the connection error count to notch up.

Andy Triggs