Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Aug 202010
 

Block a client from connecting to MySQL if too many errors

Answer:

You can block a client from connecting to MySQL if they introduced too many errors, e.g. sending incorrect password for authentication, insufficient privileges when connecting to a database etc.

To set the number of maximum allowed error, edit the MySQL configurations, e.g. /etc/my.cnf

..
max_connect_errors=100
..

So if a client exceeded this value, they will be blocked from connecting to the server.

Don't forget to restart MySQL to take effect.

# /sbin/service mysqld restart

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>