1.
DCL:用来管理数据库用户,控制数据库的访问权限
2.
/*DCL-管理用户*/
#1.查询用户
use mysql;
select *from user;
3.
#2.创建用户
#create user '用户名@’主机名' identified by '密码';
create user 'yby'@'localhost' identified by '123456';#创建用户,只能在当前主机访问
4.
#3.修改密码
alter user 'yby'@'localhost' identified with mysql_native_password by '12345';
5.
#4.删除用户
drop user 'yby'@'localhost';
6.
/*DCL-权限控制*/
#1.查询权限
show grants for 'yby'@'localhost';
#2.授予权限
grant all on root.* to 'yby'@'localhost';
#3.撤销权限
revoke all on root.* from 'yby'@'localhost';