privileges_by_table_by_level Sys Schema View
The privileges_by_table_by_level view lists granted privileges broken down by table and the level (Global, Schema, or Table) at which they were granted.
Description
Column
Description
Example
SELECT * FROM sys.privileges_by_table_by_level;
+--------------+------------+---------------------------+----------------+--------+
| TABLE_SCHEMA | TABLE_NAME | GRANTEE | PRIVILEGE | LEVEL |
+--------------+------------+---------------------------+----------------+--------+
...
| test | t2 | 'root'@'localhost' | SELECT | GLOBAL |
| test | t1 | 'root'@'localhost' | SELECT | GLOBAL |
| test | t3 | 'root'@'localhost' | SELECT | GLOBAL |
| test | t2 | 'root'@'localhost' | INSERT | GLOBAL |
| test | t1 | 'root'@'localhost' | INSERT | GLOBAL |
| test | t3 | 'root'@'localhost' | INSERT | GLOBAL |
| test | t2 | 'root'@'localhost' | UPDATE | GLOBAL |
| test | t1 | 'root'@'localhost' | UPDATE | GLOBAL |
| test | t3 | 'root'@'localhost' | UPDATE | GLOBAL |
| test | t2 | 'root'@'localhost' | DELETE | GLOBAL |
| test | t1 | 'root'@'localhost' | DELETE | GLOBAL |
| test | t3 | 'root'@'localhost' | DELETE | GLOBAL |
| test | t2 | 'root'@'localhost' | CREATE | GLOBAL |
| test | t1 | 'root'@'localhost' | CREATE | GLOBAL |
| test | t3 | 'root'@'localhost' | CREATE | GLOBAL |
| test | t2 | 'root'@'localhost' | DROP | GLOBAL |
| test | t1 | 'root'@'localhost' | DROP | GLOBAL |
| test | t3 | 'root'@'localhost' | DROP | GLOBAL |
| test | t2 | 'root'@'localhost' | REFERENCES | GLOBAL |
| test | t1 | 'root'@'localhost' | REFERENCES | GLOBAL |
| test | t3 | 'root'@'localhost' | REFERENCES | GLOBAL |
| test | t2 | 'root'@'localhost' | INDEX | GLOBAL |
| test | t1 | 'root'@'localhost' | INDEX | GLOBAL |
| test | t3 | 'root'@'localhost' | INDEX | GLOBAL |
| test | t2 | 'root'@'localhost' | ALTER | GLOBAL |
| test | t1 | 'root'@'localhost' | ALTER | GLOBAL |
| test | t3 | 'root'@'localhost' | ALTER | GLOBAL |
| test | t2 | 'root'@'localhost' | SHOW VIEW | GLOBAL |
| test | t1 | 'root'@'localhost' | SHOW VIEW | GLOBAL |
| test | t3 | 'root'@'localhost' | SHOW VIEW | GLOBAL |
| test | t2 | 'root'@'localhost' | TRIGGER | GLOBAL |
| test | t1 | 'root'@'localhost' | TRIGGER | GLOBAL |
| test | t3 | 'root'@'localhost' | TRIGGER | GLOBAL |
| test | t2 | 'root'@'localhost' | DELETE HISTORY | GLOBAL |
| test | t1 | 'root'@'localhost' | DELETE HISTORY | GLOBAL |
| test | t3 | 'root'@'localhost' | DELETE HISTORY | GLOBAL |
| test | t2 | 'PUBLIC'@'' | SELECT | SCHEMA |
| test | t1 | 'PUBLIC'@'' | SELECT | SCHEMA |
| test | t3 | 'PUBLIC'@'' | SELECT | SCHEMA |
| test | t2 | 'PUBLIC'@'' | INSERT | SCHEMA |
| test | t1 | 'PUBLIC'@'' | INSERT | SCHEMA |
| test | t3 | 'PUBLIC'@'' | INSERT | SCHEMA |
| test | t2 | 'PUBLIC'@'' | UPDATE | SCHEMA |
| test | t1 | 'PUBLIC'@'' | UPDATE | SCHEMA |
| test | t3 | 'PUBLIC'@'' | UPDATE | SCHEMA |
| test | t2 | 'PUBLIC'@'' | DELETE | SCHEMA |
| test | t1 | 'PUBLIC'@'' | DELETE | SCHEMA |
| test | t3 | 'PUBLIC'@'' | DELETE | SCHEMA |
| test | t2 | 'PUBLIC'@'' | CREATE | SCHEMA |
| test | t1 | 'PUBLIC'@'' | CREATE | SCHEMA |
| test | t3 | 'PUBLIC'@'' | CREATE | SCHEMA |
| test | t2 | 'PUBLIC'@'' | DROP | SCHEMA |
| test | t1 | 'PUBLIC'@'' | DROP | SCHEMA |
| test | t3 | 'PUBLIC'@'' | DROP | SCHEMA |
| test | t2 | 'PUBLIC'@'' | REFERENCES | SCHEMA |
| test | t1 | 'PUBLIC'@'' | REFERENCES | SCHEMA |
| test | t3 | 'PUBLIC'@'' | REFERENCES | SCHEMA |
| test | t2 | 'PUBLIC'@'' | INDEX | SCHEMA |
| test | t1 | 'PUBLIC'@'' | INDEX | SCHEMA |
| test | t3 | 'PUBLIC'@'' | INDEX | SCHEMA |
| test | t2 | 'PUBLIC'@'' | ALTER | SCHEMA |
| test | t1 | 'PUBLIC'@'' | ALTER | SCHEMA |
| test | t3 | 'PUBLIC'@'' | ALTER | SCHEMA |
| test | t2 | 'PUBLIC'@'' | SHOW VIEW | SCHEMA |
| test | t1 | 'PUBLIC'@'' | SHOW VIEW | SCHEMA |
| test | t3 | 'PUBLIC'@'' | SHOW VIEW | SCHEMA |
| test | t2 | 'PUBLIC'@'' | TRIGGER | SCHEMA |
| test | t1 | 'PUBLIC'@'' | TRIGGER | SCHEMA |
| test | t3 | 'PUBLIC'@'' | TRIGGER | SCHEMA |
| test | t2 | 'PUBLIC'@'' | DELETE HISTORY | SCHEMA |
| test | t1 | 'PUBLIC'@'' | DELETE HISTORY | SCHEMA |
| test | t3 | 'PUBLIC'@'' | DELETE HISTORY | SCHEMA |
+--------------+------------+---------------------------+----------------+--------+See Also
Last updated
Was this helpful?

