Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The question is in the title. I would like to disable accounts after x failed login attempts. Is it possible?

Thank you

share|improve this question

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,]
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.

share|improve this answer

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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