如何在MySQL中“减去”权限

我想撤销来自“transact”表的2列的更新权限.
我希望用户能够访问所有其他表和数据.

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节中描述的:

“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已经描述了获得选择性权限.

上一篇:【MySQL数据库】使用Navicat Premium 12连接出现1130-host ... is not allowed to connect to this MySql server


下一篇:03:不高兴的津津