数据库练习题(四)

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'@'%';
  • 9
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值