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_privileges
table comes from the mysql.db
table, however also granting select
for mysql.db
doesn'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'