DCL 操作
data control language 数据库控制语言,用来管理数据库用户,控制数据库访问权限
1. 查询用户
use mysql;
select * from user;
# host: localhost 表示只允许当前主机访问,% 允许所有主机访问
2. 创建用户
create user 用户名@主机 identified by 密码
create user 'abc'@'localhost' identified by '12334';
2. 修改用户
alter user 'abc'@'localhost' identified with mysql_native_password by '123';
3. 删除用户
drop user 'abc'@'localhost'