MySQL 8.0.19支持输入3次密码错误,锁定账户功能

例子:>CREATE USER ‘hechunyang’@’localhost’ IDENTIFIED BY ‘123456’ FAILED_LOGIN_ATTEMPTS 3 PASSWORD_LOCK_TIME 3;

FAILED_LOGIN_ATTEMPTS:代表尝试失败的次数

PASSWORD_LOCK_TIME:代表锁定的时间,单位天,这里为锁定3天。

如果设置UNBOUNDED,代表锁定永久,直到手工解锁。

故意输错3次以上密码,账户被锁定,如下所示:# mysql -hlocalhost -uhechunyang -p123456789 -S /tmp/mysql_hcy.sock

mysql: [Warning] Using a password on the command line interface can be insecure.

ERROR 3955 (HY000): Access denied for user ‘hechunyang’@’localhost’.

Account is blocked for 3 day(s) (3 day(s) remaining) due to 3 consecutive failed logins.

手工解锁:alter user hechunyang@’localhost’ ACCOUNT UNLOCK;

标签:8.0,19,MySQL,hechunyang,ATTEMPTS,mysql,锁定,localhost

来源: https://blog.51cto.com/hcymysql/2467854

————————————————
版权声明:本文为CSDN博主「李菜单」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/weixin_42525369/article/details/114842800