需要哪些授权才能查看 information_schema.schema_privileges 中*其他*用户的权限?

发布于 2024-08-30 04:52:22 字数 970 浏览 5 评论 0原文

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

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

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

文档中,它说信息schema_privileges 表中的内容来自 mysql.db 表,但是也为 mysql.db 授予 select 权限”似乎没有什么区别。我仍然只能看到我自己对相关数据库的资助。

有人知道需要哪些赠款吗?

我当前的补助金如下:

show grants;
为 myuser@localhost
提供资助 将 . 的使用权限授予由密码“XXX”识别的“myuser”@“localhost”
使用授予选项将 myproject.* 上的选择、插入、更新、删除、创建和删除授予 'myuser'@'localhost'
mysql.user 上的选择授予 'myuser'@'localhost'
mysql.db 上的选择授予 'myuser'@'localhost'

For a specific database in a MySQL Server 5.5 I would like to view all grants given to any user. To do this I have been reading from the information_schema.schema_privileges table using a select statement as follows:

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

The problem is that I only see my own grants for the database. I am therefore trying to modify my grants such that the grants for all users for that database are listed in the results of the select.

In the documentation it says that the information in the schema_privilegestable comes from the mysql.dbtable, however also granting select for mysql.dbdoesn't seem to make any difference. I still only see my own grants for the database in question.

Does anyone have any ideas which grants are required?

My current grants are as follows:

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'

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

太阳公公是暖光 2024-09-06 04:52:22

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

从 mysql.db 中选择用户、主机、select_priv、insert_priv、update_priv、delete_priv、create_priv、drop_priv、grant_priv,其中 Db='myproject';

OK, I solved it by just reading out directly from the mysql.db table. It was much simpler in the end!

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文