Friday, August 15, 2014

Host errors in MySQL

Sometimes you get the following error in mySQL

There is an error in get connection. <Host> is blocked because of many connections error; unblock 
with 'mysqladmin flush-hosts'

The happens because of certain number of connections failing from the host, mysql assumes that someone is trying to break in and it blocks the host from connecting further. If the host has to be allowed than on the database server run

mysqladmin flush-hosts

Sometimes running mysqladmin gives the following error:

mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'ODBC'@'localhost' (using password: NO)'

In that case, run with

mysqladmin -h -u root -p flush-hosts

and be ready with the root password

You can bump up the max_connect_errors also which by default is 10. It means after 10 bad connections, the server will refuse to honour the connection request of the particular host. To bump up the connection, do following in mysql window using admin credential

set GLOBAL max_connect_errors = 100

Access Problem

When following error message occurs,

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
than, start mysql with the following arguments

mysql -h -u root -p

Where root is the user with which you want to login.

No comments:

Post a Comment