当前位置:网站首页>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 */

边栏推荐
- UEditor V1.4.3控制文件压缩
- 指令系统超全知识点详解
- Talk about the problem of preventing others from debugging websites through console based on JS implementation
- 巧用ngx_lua做流量分组
- 【微信小程序】项目实战—抽签应用
- gcc: error trying to exec 'as': execvp: No such file or directory
- Double pointer technique
- 记录一次idea中的父子项目修改project与module名称,亲测!
- SuperMap iServer发布管理以及调用地图服务
- Detailed explanation of super complete knowledge points of instruction system
猜你喜欢

语音聊天app——如何规范开发流程?

IDEA创建我的第一个项目

SQL Server 2016学习记录 --- 连接查询

Match file names from file paths using regular expressions

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

SQL Server 2016 学习记录 --- 嵌套查询

11. Linked list inversion

7. Dichotomy -- find a set of repeated or ordered but rotating arrays

Guangzhou metro line 14 xinshixu station is under construction, and residents in Baiyun District are about to start a double line transfer mode!

API 网关 APISIX 在Google Cloud T2A 和 T2D 的性能测试
随机推荐
Uni app advanced life cycle
读写分离备机备份报错
UEditor V1.4.3控制文件压缩
Typora tutorial
Lucene 查询语法备忘
It's settled! On July 30!
字符串匹配
Xu Ziyang, President of ZTE: 5nm chip will be launched in 2021
13、哈希表——两个链表第一个公共节点
Prometheus operation and maintenance tool promtool (IV) TSDB function
9. Delete nodes in the linked list
4. Adjust the array order so that odd numbers precede even numbers
Ie compatibility problem handling
漏洞分析丨HEVD-0x8.IntegerOverflow[win7x86]
7、二分法——寻找一组重复或者有序但是旋转的数组
Problem summary file
基于docker安装MySQL
Summary of key points of bank entry examination
[cloud based co creation] Huawei cloud: metastudio digital content production line, which seamlessly integrates the virtual world with the real world
pt-kill 查询中包含中文字符 导致工具失效的排查