Note
This view is available starting with V3.2.1.
Purpose
This view displays the global privileges of a user (VIRTUAL_TABLE).
Columns
| Column | Type | Nullable | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| host | varchar(128) | NO | The host name. | ||||||||||
| user | varchar(128) | NO | The username. | ||||||||||
| password | varchar(128) | NO | The user password. | ||||||||||
| select_priv | varchar(1) | NO | Indicates whether the user can execute SELECT statements. | ||||||||||
| insert_priv | varchar(1) | NO | Indicates whether the user can execute INSERT statements. | ||||||||||
| update_priv | varchar(1) | NO | Indicates whether the user can execute UPDATE statements. | ||||||||||
| delete_priv | varchar(1) | NO | Indicates whether the user can execute DELETE statements. | ||||||||||
| create_priv | varchar(1) | NO | Indicates whether the user can execute CREATE statements. | ||||||||||
| drop_priv | varchar(1) | NO | Indicates whether the user can execute DROP statements. | ||||||||||
| reload_priv | varchar(1) | NO | Indicates whether the user can execute FLUSH statements. This field is not currently used. | ||||||||||
| shutdown_priv | varchar(1) | NO | Indicates whether the user can execute the SHUTDOWN command. This field is not currently used. | ||||||||||
| process_priv | varchar(1) | NO | Indicates whether the user can query active thread information. | ||||||||||
| file_priv | varchar(1) | NO | Indicates whether the user has file read/write permissions. This field is not currently used. | ||||||||||
| grant_priv | varchar(1) | NO | Indicates whether the user can execute GRANT statements. | ||||||||||
| reference_priv | varchar(1) | NO | This field is not currently used. | ||||||||||
| index_priv | varchar(1) | NO | Indicates whether the user can create indexes. | ||||||||||
| alter_priv | varchar(1) | NO | Indicates whether the user can execute ALTER statements. | ||||||||||
| show_db_priv | varchar(1) | NO | Indicates whether the user can execute the show database statement. |
||||||||||
| super_priv | varchar(1) | NO | Indicates whether the user can execute superuser statements. | ||||||||||
| create_tmp_table_priv | varchar(1) | NO | Indicates whether the user can create temporary tables (not used). | ||||||||||
| lock_tables_priv | varchar(1) | NO | Indicates whether the user can execute the lock tables statement. This field is not currently used. |
||||||||||
| execute_priv | varchar(1) | NO | Indicates whether the user can execute stored procedures. This field is not currently used. | ||||||||||
| repl_slave_priv | varchar(1) | NO | This field is not currently used. | ||||||||||
| repl_client_priv | varchar(1) | NO | This field is not currently used. | ||||||||||
| create_view_priv | varchar(1) | NO | Indicates whether the user can create views. | ||||||||||
| show_view_priv | varchar(1) | NO | Indicates whether the user can execute the show create view statement. |
||||||||||
| create_routine_priv | varchar(1) | NO | Indicates whether the user can create stored procedures. This field is not currently used. | ||||||||||
| alter_routine_priv | varchar(1) | NO | Indicates whether the user can modify stored procedures. This field is not currently used. | ||||||||||
| create_user_priv | varchar(1) | NO | Indicates whether the user can execute the create user statement. |
||||||||||
| event_priv | varchar(1) | NO | Whether to allow creating, changing, or deleting events. This column is not currently used. | ||||||||||
| trigger_priv | varchar(1) | NO | Whether you have permission to operate triggers. This column is not currently used. | ||||||||||
| create_tablespace_priv | varchar(1) | NO | This column is reserved for future use. | ||||||||||
| ssl_type | varchar(10) | NO | This column is not currently in use. | ||||||||||
| ssl_cipher | varchar(1024) | NO | This column is not currently used. | ||||||||||
| Column | Type | Nullable | Description | ----------------------- | ---------------- | ---------- | ------------- | x509_issuer | varchar(1024) | NO | This column is not currently used. | ||
| x509_subject | varchar(1024) | NO | This column is not used at present. | ||||||||||
| max_questions | bigint(20) | NO | The maximum number of queries that can be executed by the user per hour (not used). | ||||||||||
| max_updates | bigint(20) | NO | The maximum number of updates that a user can execute per hour. This parameter is not in use. | ||||||||||
| max_connections | bigint(20) | NO | The maximum number of connections that can be received by the user per hour. This field is not currently in use. | ||||||||||
| max_user_connections | bigint(20) | NO | The maximum number of simultaneous connections. This field is not used currently. | ||||||||||
| plugin | varchar(1024) | NO | Not used in the system. | ||||||||||
| Column | Type | Nullable | Description | ---------------- | ------------------- | ----------- | ------------------------------ | authentication_string | varchar(1024) | NO | Not currently in use. | ||
| password_expired | varchar(1) | NO | Whether the password has expired. This field is currently not in use. | ||||||||||
| account_locked | varchar(1) | NO | Displays whether the user is locked. | ||||||||||
| drop_database_link_priv | varchar(1) | NO | Whether to allow dropping database links. | ||||||||||
| create_database_link_priv | varchar(1) | NO | Whether you can create a database link. | ||||||||||
| create_role_priv | varchar(1) | NO | Grants the right to create a role. | ||||||||||
| drop_role_priv | varchar(1) | NO | Whether to allow dropping roles. |
Sample query
Query the global privileges of user test2.
obclient [oceanbase]> SELECT * FROM mysql.user WHERE user=‘'test2'\G
The query result is as follows:
*************************** 1. row ***************************
host: %
user: test2
password: *************************************
select_priv: N
insert_priv: N
update_priv: N
delete_priv: N
create_priv: N
drop_priv: N
reload_priv: N
shutdown_priv: N
process_priv: N
file_priv: N
grant_priv: N
references_priv: N
index_priv: N
alter_priv: N
show_db_priv: N
super_priv: N
create_tmp_table_priv: N
lock_tables_priv: N
execute_priv: N
repl_slave_priv: N
repl_client_priv: N
create_view_priv: N
show_view_priv: N
create_routine_priv: N
alter_routine_priv: N
create_user_priv: N
event_priv: N
trigger_priv: N
create_tablespace_priv: N
ssl_type:
ssl_cipher:
x509_issuer:
x509_subject:
max_questions: 0
max_updates: 0
max_connections: 0
max_user_connections: 0
plugin: ob_native_password
authentication_string:
password_expired:
account_locked: N
drop_database_link_priv: N
create_database_link_priv: N
create_role_priv: N
drop_role_priv: N
1 row in set