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.

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

  1. Set the maximum allowed number of connections in MySQL
  2. Clear screen in MySQL client
  3. Vertical (\G) output of query result in MySQL client
  4. Disable DNS hostname lookup in MySQL
  5. How to execute SQL file with MySQL

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>