mysqllinuxfail2banlogin-attempts

Log failed login attempts in mysql 8


I set up a mysql 8 server on a unix shell and want to access the database by remote sql client.

For sequrity i installed fail2ban to blacklist bruteforce attacks.

But mysql wont give me failed login attempts.

I know this question was asked a lot before bit its all about mysql 5

So log_warnings is no more.

I set log_error_verbosity = 2 in mysqld.cnf but error.log just logs start and shutdoen notifications.

I read about the new error_log_components but cant figure out how it affects failed authentifications.


Solution

  • According to the docs you should set the log_error_verbosity variable to 3:

    If the value is 3, the server logs aborted connections and access-denied errors for new connection attempts.