Note
This view is introduced in V4.0.0.
Description
Displays the column privileges.
Fields
Field |
Type |
Whether the value can be NULL |
Description |
|---|---|---|---|
| GRANTEE | varchar(292) | NO | The name of the user granted with the access privilege. |
| TABLE_CATALOG | varchar(512) | NO | The name of the catalog to which the table containing the column belongs. This value is always def. |
| TABLE_SCHEMA | varchar(64) | NO | The name of the database to which the table containing the column belongs. |
| TABLE_NAME | varchar(64) | NO | The name of the table containing the column. |
| COLUMN_NAME | varchar(64) | NO | The name of the column. |
| PRIVILEGE_TYPE | varchar(64) | NO | The privilege granted. This value can be any privilege granted at the column level. |
| IS_GRANTABLE | varchar(3) | NO | YES: The user has the privilege to grant.NO: The user does not have the privilege to grant. |
Examples
The following example shows how to view the column privileges of a user.
obclient [information_schema]> SELECT * FROM information_schema.COLUMN_PRIVILEGES;
The following table shows the sample result.
+-------------+---------------+--------------+------------+-------------+----------------+--------------+
| 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
Related views and documents
To view the columns of privileges granted to a user, see mysql.columns_priv.
