数据库之用户权限管理

关于Struts2 spring + hibernate进Q群: 130529143交流。
有偿技术支持Q群:
398162181 

创建角色-〉授予权限-〉分配给用户

--创建角色
create role my_role;


--给角色授予权限
grant create session, create table, create view to my_role;


--将权限授予用户
grant my_role to atguigu02;


--将其他用户的对象授权于指定用户(可以使用系统级用户,也可以是对象的拥有者)
grant select, update on scott.employees to atguigu



--将其他用户的对象授权于指定用户,
grant select on scott.depatments to atguigu with grant option;
--with grant option,获得该权限的用户具有授予给其他用户的权限



--具有授予的行为
grant select on scott.depatments to public;
--with grant option,所有用户都拥有该权限





创建控制用户权限




--创建用户(使用系统级帐户)
create user scott01 identified by scott01;


--给用户授权(使用系统级帐户,管理atguigu)
grant create session, create table to atguigu;


--为用户分配空间大小(使用系统级帐户)
alter user atguigu quota unlimited on users;


--修改用户名密码(使用本帐户就可修改,即自己可以改密码)
alter user atguigu identified by atguigu;


--收回对象权限
revoke select on scott.employees from atguigu;

关于Struts2 spring + hibernate进Q群: 130529143交流。
有偿技术支持Q群:
398162181 












评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值