SQL语句---DCL
创建用户itcast只能多在当前主机localhost访问,密码123456;
create user 'itcast'@'localhost' identified by '123456';
-创建用户heima可以在任意主机访问该数据库,密码123456:
create user 'heima'@'%' identified by'123456';
修改用户heima的访问密码为1234;
alter user 'heima'@'%' identified with mysql_native_password by '1234';
--则除itcast@localhost用户
drop user 'itcast'@'localhost';
DCL-权限控制
查询权限
- 查询权限
show grants for 'heima'@'%';
授予权限
grant all on example.* to 'heima'@'%';
撤消权限
revoke all on example.* from 'heima'@'%';
标签:heima,DCL,itcast,---,user,SQL,123456,localhost
From: https://www.cnblogs.com/harper886/p/17606963.html