2

I'd like to write a query to select all the mysql users that can select data from a given table in a database. I need to see who can access so a decision can be made higher up as to who can still select data from over there and who shouldn't.
Is there any way to do that? I tried

show grants

and selecting from mysql.db but I don't understand it only seems to specify database level privileges and I need to see all the users that can access a certain table.

4

1 回答 1

0
SELECT grantee
FROM information_schema.TABLE_PRIVILEGES
WHERE table_name = 'mytable'

这个查询对我有用

于 2012-08-21T11:26:13.993 回答