MySQL 用户管理

2021-06-30  本文已影响0人  Joening

创建用户

mysql> create user qiaoning@'localhost' identified by '123';
Query OK, 0 rows affected (0.00 sec)

mysql> create user qiaoning@'10.0.0.%' identified by '123';
Query OK, 0 rows affected (0.00 sec)

删除用户

mysql> drop user qiaoning@'localhost';
Query OK, 0 rows affected (0.00 sec)
mysql> drop user qiaoning@'10.0.0.%';
Query OK, 0 rows affected (0.00 sec)

锁定用户 及 解锁用户

mysql> alter user qiaoning@'localhost' account lock;
Query OK, 0 rows affected (0.00 sec)
mysql> alter user qiaoning@'localhost' account unlock;
Query OK, 0 rows affected (0.00 sec)

修改密码

mysql> alter user qiaoning@'localhost' identified by '123';
上一篇 下一篇

猜你喜欢

热点阅读