kkh
kkh

Reputation: 4869

Keep getting failed connections to db

I am using codeigniter for a project and whenever I try to connect to the db from my development machine , I always get this error

Cannot connect to the database because: Host '**' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'

where ** is the ip address blocked.

So I flush my hosts yesterday and it happened again today. But the credentials for the db is correct. What can be other reasons causing this? How do I go about investigating this?

Upvotes: 0

Views: 286

Answers (2)

Vinod VT
Vinod VT

Reputation: 7159

It means that mysqld has received many connection requests from the given host that were interrupted in the middle.

By default, mysqld blocks a host after 10 connection errors. You can adjust the value by setting max_connect_errors at server startup:

shell> mysqld_safe --max_connect_errors=10000 &

The value can also be set at runtime:

mysql> SET GLOBAL max_connect_errors=10000;

For more details refer, http://dev.mysql.com/doc/refman/5.0/en/blocked-host.html

Upvotes: 0

Vikram Jain
Vikram Jain

Reputation: 5588

Please, use this for increase maximum error encounter with mysql:

shell> mysqld_safe --max_connect_errors=10000 &

Upvotes: 1

Related Questions