🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
用户lock 1、通过create user 或者alter user命令中带account lock或者unlock设置用户的lock状态 create user语句默认用户时unlock状态, ~~~ mysql> create user test6@'localhost' identified by '123456' account lock; Query OK, 0 rows affected (0.00 sec) ~~~ 2、alter user 默认不会修改用户的lock/unlock状态 ~~~ 解锁: mysql> alter user 'test6'@localhost account unlock; 加锁: mysql> alter user 'test6'@localhost account lock; ~~~ 报错信息: ~~~ [root@mysql2 ~]# mysql -u test6 -p123456 mysql: [Warning] Using a password on the command line interface can be insecure. ERROR 3118 (HY000): Access denied for user 'test6'@'localhost'. Account is locked. ~~~