开发者

MySQL views and authorization

I'm a little confused on how exactly views and authorizations work. Let's say a view, view1, is created based only off table1, and a user is granted access to the original table1. Would that user be able to have the same privileges to view1 as they would have on table1? Also if a us开发者_运维技巧er is granted permission to update/insert/delete on view1, would that privilege be possible as they would also change the underlying table1?

Thanks!


The permissions are totally seperate, here is an example

create table table1
(
    blah int
)

create view view1 as
select * from table1

Having permission on table1 does not mean you have permissions on view1, and permissions on table1 are not required to be able to use view1. This is one of the uses of views, it allows you to easily grant access to only a subset of the data in a table.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜