Tip
This view has been available since the V1.4 version.
Purpose
The permission details of a database are displayed.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| GRANTEE | varchar(81) | NO | The account to which privileges are granted. |
| TABLE_CATALOG | varchar(512) | NO | The catalog. The value of this column is always def. |
| TABLE_SCHEMA | varchar(128) | NO | The name of the database. |
| PRIVILEGE_TYPE | varchar(64) | NO | The grantee's privileges. |
| IS_GRANTABLE | varchar(3) | NO | Indicates whether a privilege can be granted. |
Sample query
Display the first 5 records of database privileges.
obclient [oceanbase]> SELECT * FROM information_schema.SCHEMA_PRIVILEGES LIMIT 5;
The query result is as follows:
+------------+---------------+--------------------+----------------+--------------+
| GRANTEE | TABLE_CATALOG | TABLE_SCHEMA | PRIVILEGE_TYPE | IS_GRANTABLE |
+------------+---------------+--------------------+----------------+--------------+
| 'root'@'%' | def | information_schema | ALTER | NO |
| 'root'@'%' | def | information_schema | CREATE | NO |
| 'root'@'%' | def | information_schema | DELETE | NO |
| 'root'@'%' | def | information_schema | DROP | NO |
| 'root'@'%' | def | information_schema | INSERT | NO |
+------------+---------------+--------------------+----------------+--------------+
5 rows in set