当前位置:网站首页>MySQL grants the user the operation permission of the specified content
MySQL grants the user the operation permission of the specified content
2022-07-06 15:57:00 【Flame car】
Grant users a library 、 The permissions of a table or a column can be easily found (GRANT), But there is a problem: how to grant the user the operation permission of the specified content ??
A problem of database experiment :
Suppose a user is CS Department managers , The authority that needs to be given to him only includes adding, deleting, checking and modifying the information of the computer department teacher , How to achieve ?
At first, I thought it was the same as specifying a column , Nothing more than specifying a certain line . Then Baidu spent a long time and found that it didn't say what to do at all ? Then it's time to go to bed , Suddenly thought of whether to re create a table and specify the rows of the things on that table ( Department of Computer Science ) Let it go ?
Come here , I suddenly remembered that one of the videos given by the teacher was view operation ( Why didn't I see it ???), I wonder if I should map the table to the view first , Then give the permission of the view to the user ? Then I checked again , You can modify the original table by modifying the view , That is to say, it really does .
summary : The user is not directly authorized to operate the specified content GRANT, You need to create a view through conditions and then grant users the operation permission of the view to achieve this effect .
Specific operation :
CREATE VIEW cs_instructor AS
SELECT *
FROM instructor
WHERE dept_name = 'Comp. Sci.'
Create a view , Inside is the information of the computer department teacher .
GRAND SELECT ON cs_instructor TO 'name'@'localhost';
In this way, the permission is granted to the user ,TO The following single quotation mark can be added or not .
Then you may have to modify the permissions of the view , hold Definer Change it to Invoker, But I don't know why I use it instead Definer To open ……
边栏推荐
- Cost accounting [19]
- 【练习-3】(Uva 442)Matrix Chain Multiplication(矩阵链乘)
- SSM框架常用配置文件
- cs零基础入门学习记录
- Path problem before dynamic planning
- 信息安全-安全编排自动化与响应 (SOAR) 技术解析
- [exercise-2] (UVA 712) s-trees
- MySQL授予用户指定内容的操作权限
- [analysis of teacher Gao's software needs] collection of exercises and answers for level 20 cloud class
- China potato slicer market trend report, technical dynamic innovation and market forecast
猜你喜欢

Learning record: use stm32f1 watchdog

D - Function(HDU - 6546)女生赛

X-Forwarded-For详解、如何获取到客户端IP

Ball Dropping

数据在内存中的存储&载入内存,让程序运行起来

【高老师软件需求分析】20级云班课习题答案合集

C语言是低级和高级的分水岭

STM32 how to use stlink download program: light LED running light (Library version)

Penetration test (8) -- official document of burp Suite Pro

信息安全-威胁检测引擎-常见规则引擎底座性能比较
随机推荐
STM32如何使用STLINK下载程序:点亮LED跑马灯(库版本)
Information security - Epic vulnerability log4j vulnerability mechanism and preventive measures
【练习-3】(Uva 442)Matrix Chain Multiplication(矩阵链乘)
信息安全-史诗级漏洞Log4j的漏洞机理和防范措施
滲透測試 ( 1 ) --- 必備 工具、導航
[exercise-2] (UVA 712) s-trees
D - Function(HDU - 6546)女生赛
Penetration test (3) -- Metasploit framework (MSF)
Gartner:关于零信任网络访问最佳实践的五个建议
初入Redis
信息安全-威胁检测-NAT日志接入威胁检测平台详细设计
Research Report of cylindrical grinder industry - market status analysis and development prospect forecast
Research Report of peripheral venous catheter (pivc) industry - market status analysis and development prospect prediction
渗透测试 ( 4 ) --- Meterpreter 命令详解
Information security - threat detection - detailed design of NAT log access threat detection platform
数据在内存中的存储&载入内存,让程序运行起来
China's peripheral catheter market trend report, technological innovation and market forecast
E. Breaking the Wall
STM32 learning record: LED light flashes (register version)
Research Report of exterior wall insulation system (ewis) industry - market status analysis and development prospect prediction