当前位置:网站首页>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 [14]
- Cost accounting [16]
- Learning records: serial communication and solutions to errors encountered
- 【练习-5】(Uva 839)Not so Mobile(天平)
- Find 3-friendly Integers
- Perinatal Software Industry Research Report - market status analysis and development prospect forecast
- Matlab comprehensive exercise: application in signal and system
- 最全编程语言在线 API 文档
- 【练习-11】4 Values whose Sum is 0(和为0的4个值)
- [exercise-4] (UVA 11988) broken keyboard = = (linked list)
猜你喜欢

STM32 learning record: LED light flashes (register version)

【高老师UML软件建模基础】20级云班课习题答案合集

渗透测试 ( 5 ) --- 扫描之王 nmap、渗透测试工具实战技巧合集

Learning record: how to perform PWM output

信息安全-安全编排自动化与响应 (SOAR) 技术解析

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

Information security - Analysis of security orchestration automation and response (soar) technology

信息安全-威胁检测-flink广播流BroadcastState双流合并应用在过滤安全日志
![mysql导入数据库报错 [Err] 1273 – Unknown collation: ‘utf8mb4_0900_ai_ci’](/img/e6/f4a696179282fe1f4193410c5a493a.png)
mysql导入数据库报错 [Err] 1273 – Unknown collation: ‘utf8mb4_0900_ai_ci’

差分(一维,二维,三维) 蓝桥杯三体攻击
随机推荐
最全编程语言在线 API 文档
Market trend report, technical innovation and market forecast of lip care products in China and Indonesia
China's earthwork equipment market trend report, technical dynamic innovation and market forecast
HDU - 6024 Building Shops(女生赛)
Learning record: how to perform PWM output
0-1背包问题(一)
China earth moving machinery market trend report, technical dynamic innovation and market forecast
【高老师UML软件建模基础】20级云班课习题答案合集
【练习-8】(Uva 246)10-20-30==模拟
Information security - Analysis of security orchestration automation and response (soar) technology
Opencv learning log 15 count the number of solder joints and output
渗透测试 ( 7 ) --- 漏洞扫描工具 Nessus
Determine the Photo Position
【高老师软件需求分析】20级云班课习题答案合集
MySQL授予用户指定内容的操作权限
Information security - threat detection - detailed design of NAT log access threat detection platform
Essai de pénétration (1) - - outils nécessaires, navigation
Research Report on market supply and demand and strategy of China's earth drilling industry
HDU-6025-Coprime Sequence(女生赛)
【练习-10】 Unread Messages(未读消息)