当前位置:网站首页>Database security - create login user + configure permissions [notes]
Database security - create login user + configure permissions [notes]
2022-07-28 10:24:00 【Hard work Zhang Zhang】
Project scenario :
Create and authorize users
Solution :
1、 Create user 







At this point, the user was successfully created :
2、 Configure permissions 
Put the inquiry Student Table permissions are granted to users test:

Put right Student Table and Course All permissions for the table are granted to the user U2 and U3
-- Put the inquiry Student Table permissions are granted to users test
grant select on Student to test;

problem 2:all privilege Can not use ?
-- Put right Student Table and Course All permissions for the table are granted to the user test and U1
grant all
on Student to test,U1;
grant all
on Course to test,U1;

-- Check the watch SC The query permission of is granted to all users
grant select on SC to public;

-- Put the inquiry Student Table and modify student ID rights granted to users U1
grant select,update(sno) on SC to U1;

3、 Create user name
-- Create login , Create user
create login zff with password='***',DEFAULT_DATABASE=STU1;
-- to zff Login to create a user U2
create user U2 for login zff;
-- Create a user without a login , Can not login , But can be granted permission
create user U3_none without login;
4、 Configure permissions for relevant users
--4.5 Check the watch SC Of INSERT Authority granted to U5 user ,
-- And allow him to grant this permission to other users
grant Insert on SC to U2 with grant option;

--4.6
create user U6 without login;
GRANT INSERT
ON SC
TO U6
WITH GRANT OPTION;
--4.7
create user U7 without login;
GRANT INSERT
ON SC
TO U7;
-- Recycling permissions
--4.8] Put the user U4 The authority to modify the student number is withdrawn
revoke update(sno) on Student from U4;

--4.9] Take back all user pairs SC The query authority of
revoke select on SC from public;

--4.10] Put the user U5 Yes SC Tabular INSERT Withdrawal of authority
revoke insert on SC from U5 cascade;
/* The system only retracts directly or indirectly from U5 Access to */

边栏推荐
- It is said that the global semiconductor equipment giant may build a joint venture factory in Shanghai!
- 2021-10-13arx
- 用两个栈实现一个队列【C语言】
- [wechat applet] project practice - lottery application
- Lucene 查询语法备忘
- 问题总结档案
- Leetcode -- minimum number of rotation array
- Consul
- 用K-means聚类分类不同行业的关税模型
- SQL Server 2016 学习记录 --- 嵌套查询
猜你喜欢

SuperMap iServer发布管理以及调用地图服务

【栈的应用】--- 中缀表达式转后缀表达式

Typora tutorial

Performance test of API gateway APIs IX in Google cloud T2a and T2D

Aqua Data Studio 18.5.0 export insert statement

IDEA打包jar包及运行jar包命令

11. Linked list inversion

5、动态规划---斐波那契数列

6. Double pointer -- the sum of the two numbers of the incremental array is equal to the target number

Aqua Data Studio 18.5.0导出insert语句
随机推荐
Detailed explanation of thread synchronization volatile and synchronized
14、双指针——盛最多水的容器
ZTE: 5nm 5g base station chip is being introduced!
5. Dynamic programming -- Fibonacci series
多线程与高并发(三)—— 源码解析 AQS 原理
SQL Server 2016 learning records - connection query
7、二分法——寻找一组重复或者有序但是旋转的数组
Differences among pipes, pipe passes and pipe States
16、字符串反转
uni-app项目目录、文件作用介绍 及 开发规范
Go json.Decoder Considered Harmful
2. Output one of the repeated numbers in the array
Step 4 - user development environment settings
用两个栈实现一个队列【C语言】
Aqua Data Studio 18.5.0 export insert statement
gcc: error trying to exec 'as': execvp: No such file or directory
用K-means聚类分类不同行业的关税模型
【微信小程序】项目实战—抽签应用
Qt | 信号和槽的一些总结
pt-kill 查询中包含中文字符 导致工具失效的排查