授予用户权限以仅查看mysql视图 [英] Grant a user permission to only view a mysql view

查看:2576
本文介绍了授予用户权限以仅查看mysql视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下问题与MySQL 5.1.44有关

The below question pertains to MySQL 5.1.44

比方说,我有一个表,其中包含应用程序的不同用户插入的记录.如何授予特定用户访问权限,使其仅查看该表中的记录?我曾考虑过用他/她的记录创建一个VIEW,但是我不知道如何创建一个只能看到VIEW的mysql用户.

Let's say I have a table with records inserted by different users of my application. How can I give a specific user access to only see his/her records in that table? I've thought about creating a VIEW with his/her records, but I don't know how to create a mysql user that can only see that VIEW.

那么,有可能创建一个只能访问单个VIEW的mysql用户吗?也可以使该用户成为只读用户对该VIEW的访问者吗?

So, is it possible to create a mysql-user that only has access to a single VIEW? can this user also be made so they read-only access to that VIEW?

谢谢!

PS:在我的示例中,我所说的 users 实际上是希望通过自己的应用程序访问其记录的子公司.

PS: What I call users in my example are really subsidiary offices that want to access their records with their own applications.

推荐答案

GRANT SELECT ON database1.view1 TO 'someuser'@'somehost';

这篇关于授予用户权限以仅查看mysql视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆