I would like to disable accounts after x failed login attempts. Is it possible?

2 Answers 2


Also you can use fail2ban for this goal as too easily way . In this case you just install it on you linux OS, then enable the section for [mysqld-iptables] in the /etc/fail2ban/jail.local.

enabled  = true
filter   = mysqld-auth
action   = iptables[name=mysql, port=3306, protocol=tcp]
       sendmail-whois[name=MySQL, dest=root, [email protected]]
logpath  = /var/log/mysqld.log
maxretry = 5

This program check the mysql logs by its own given pattern and then blocks the IP addresses which they try to login more than 5 times, in iptables.


This can be achieved using auditing logon failure event and using triggers for failure event ,Please have a look at the link Audit logins on MySQL database The locking of account may be handling at active directory locking level

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.