Note
This view was introduced in V1.4.
Purpose
You can view the permissions of a user.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| GRANTEE | varchar(81) | NO | Name of the account with the granted privileges. |
| TABLE_CATALOG | varchar(512) | NO | The table catalog, which is fixed to def. |
| PRIVILEGE_TYPE | varchar(64) | NO | The privilege that was granted. |
| IS_GRANTABLE | varchar(3) | NO | Whether the privilege is transferable. |
Sample query
Obtain the privileges granted to the user.
obclient > SELECT * FROM information_schema.USER_PRIVILEGES;
An example is shown below:
+-------------+---------------+----------------+--------------+
| GRANTEE | TABLE_CATALOG | PRIVILEGE_TYPE | IS_GRANTABLE |
+-------------+---------------+----------------+--------------+
| 'test2'@'%' | def | USAGE | NO |
+-------------+---------------+----------------+--------------+
1 row in set