如何“减去" MySQL中的特权 [英] How to "subtract" privileges in MySQL

查看:69
本文介绍了如何“减去" MySQL中的特权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想撤消表"transact"的2列中的更新特权. 我希望用户可以访问所有其他表和数据.

I want to revoke update privielges from 2 columns of table "transact". I want the user to have all access to all other tables and data.

mysql> REVOKE UPDATE (system, consumer) ON ledger.transact FROM 'foo'@'localhost';
ERROR 1147 (42000): There is no such grant defined for user 'foo' on host 'localhost' on table 'transaction'

以上似乎无效.

推荐答案

我同意Thilo-如果您之前已经授予了它们特权,那么您将只能撤消这些特权.您不能在较高级别(例如表格)上授予,然后在更详细的级别上撤销.我认为这是在mysql参考手册MySql 5.1第12.7.1.3章中描述的:

I agree with Thilo - you would only be able to revoke those column privileges if you had granted them before. You cannot grant on a higher level (e.g. table) and then revoke on a more detailed level. I think this is described in the mysql reference manual MySql 5.1 chapter 12.7.1.3:

形成了数据库,表,列或例程的特权 分别作为每个特权的逻辑或 特权级别.例如,如果用户具有全局SELECT 特权,如果没有该特权,则不能拒绝该特权 数据库,表或列级别的特权."

"The privileges for a database, table, column, or routine are formed additively as the logical OR of the privileges at each of the privilege levels. For example, if a user has a global SELECT privilege, the privilege cannot be denied by an absence of the privilege at the database, table, or column level."

Devart已经描述了如何获得选择性特权.

To get the selective privileges is described by Devart already.

这篇关于如何“减去" MySQL中的特权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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