【问题标题】:Which grants are required to see privileges for *other* users in information_schema.schema_privileges?在 information_schema.schema_privileges 中查看 *other* 用户的权限需要哪些授权?
【发布时间】:2011-02-11 13:38:51
【问题描述】:

对于 MySQL Server 5.5 中的特定数据库,我想查看授予 any 用户的所有授权。为此,我一直在使用如下 select 语句从 information_schema.schema_privileges 表中读取数据:

select * from information_schema.schema_privileges where table_schema='myproject';

问题是我只看到我对数据库的自己的 授权。因此,我正在尝试修改我的授权,以便该数据库的 所有 用户的授权都列在选择结果中。

documentation 中,它说schema_privilegestable 中的信息来自mysql.dbtable,但是也为mysql.db 授予select 似乎没有任何区别。我仍然只看到我自己对相关数据库的资助。

有人知道需要哪些资助吗?

我目前的资助如下:

show grants;
Grants for myuser@localhost
GRANT USAGE ON . TO 'myuser'@'localhost' IDENTIFIED BY PASSWORD 'XXX'
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON myproject.* TO 'myuser'@'localhost' WITH GRANT OPTION
GRANT SELECT ON mysql.user TO 'myuser'@'localhost'
GRANT SELECT ON mysql.db TO 'myuser'@'localhost'

【问题讨论】:

    标签: mysql information-schema


    【解决方案1】:

    好的,我通过直接从mysql.db 表中读取来解决它。最后简单多了!

    select user, host, select_priv, insert_priv, update_priv, delete_priv, create_priv, drop_priv, grant_priv from mysql.db where Db='myproject';

    【讨论】:

      猜你喜欢
      • 2017-11-16
      • 2023-03-24
      • 2012-03-11
      • 2011-01-01
      • 2014-08-28
      • 2015-12-28
      • 1970-01-01
      • 1970-01-01
      • 2023-04-06
      相关资源
      最近更新 更多