My colleague Miguel wrote about ways to audit login attempts in
MySQL over 13 years ago, and this is still a relevant
subject. I decided to refresh this topic to include some
important changes since then.
Very often, it is important to track login attempts to our
databases due to security reasons as well as to catch application
misconfigurations. I’ll focus here on the most convenient ways to
log authentication attempts. While auditing all client
connections is usually pointless on busy production systems, when
even thousands of new client sessions may be authenticating per
second, let’s concentrate especially on the failed ones.
The Error Log
All MySQL and MariaDB variants have an easy way of logging failed
authentication attempts in the standard error log via elevated
log verbosity. To enable it, in older MySQL versions up …
[Read more]