DCL–用户管理
1、创建用户itcast,只能够在当前主机localhost访问,密码:123456;
CREATE USER 'itcast'@'localhost' IDENTIFIED BY '123456';
2、创建用户heima,可以在任意主机上访问该数据库,密码:123456;
create user 'heima'@'%' identified by '123456';
3、修改用户密码
alter user 'heima'@'%' identified with mysql_native_password by ' 1234';
4、删除itcast用户
DROP user 'itcast'@'localhost' ;
5、查询权限
show grants for 'heima'@'%';
6、授予权限
grant all on itcast.* to 'heima'@'%';
7、撤销权限
revoke all on itcast.* to 'heima'@'%';