Overview
Displays column privilege information.
Columns
Field Name |
Type |
Whether can be NULL |
Description |
|---|---|---|---|
| GRANTEE | varchar(292) | NO | Name of the user granted access permissions |
| TABLE_CATALOG | varchar(512) | NO | The name of the directory to which the table containing the column belongs. This value is always 'def'. |
| TABLE_SCHEMA | varchar(64) | NO | The database to which the table containing the column belongs. |
| TABLE_NAME | varchar(64) | NO | Table name containing the column |
| COLUMN_NAME | varchar(64) | NO | Column name |
| PRIVILEGE_TYPE | varchar(64) | NO | The granted privilege. This can be any privilege granted at the column level. |
| IS_GRANTABLE | varchar(3) | NO |
|
Sample query
Query column privileges of a user.
obclient [information_schema]> SELECT * FROM information_schema.COLUMN_PRIVILEGES;
The query result is as follows:
+-------------+---------------+--------------+------------+-------------+----------------+--------------+
| GRANTEE | TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME | COLUMN_NAME | PRIVILEGE_TYPE | IS_GRANTABLE |
+-------------+---------------+--------------+------------+-------------+----------------+--------------+
| 'user2'@'%' | def | test1 | tbl1 | c1 | INSERT | YES |
| 'user1'@'%' | def | test1 | tbl1 | c1 | SELECT | NO |
+-------------+---------------+--------------+------------+-------------+----------------+--------------+
2 rows in set
References
Query column privileges granted to users: mysql.columns_priv