1

I have the following scenario:

MySQL server:
IP: 192.168.0.1
user: testing
pass: testing123123

MySQL client #1:
IP: 192.168.0.2

MySQL client #2:
IP: 192.168.0.3

Into MySQL server:

GRANT ALL PRIVILEGES ON *.* TO testing@'192.168.0.2' IDENTIFIED BY 'testing123123';
flush privileges;

Client #1 is granted and Client #2 is NOT granted.

Then in Client #1 shell:

mysql -h192.168.0.1 -uuser_bla_bla -pbla_bla_bla
ERROR 1045 (28000): Access denied for user 'user_bla_bla'@'192.168.0.2' (using password: YES)

Into Mysql Server log:

2017-03-11 12:13:10 82588 [Warning] Access denied for user 'user_bla_bla'@'192.168.0.2' (using password: YES)

Everything is OK: wrong username/password >> access denied >> log recorded

Now Client #2 shell:

mysql -h192.168.0.1 -uuser_bla_bla -pbla_bla_bla
ERROR 1130 (HY000): Host '192.168.0.3' is not allowed to connect to this MySQL server

Into Mysql Server log: NOTHING!

My my.cnf:

[mysqld]
log_warnings = 2
log_error=/var/log/mysql_error.log

MySQL log is not logging "host is not allowed", it only logs "Access denied for user".

QUESTION: How to log MySQL "host is not allowed" cases?

Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.