Note
This view is introduced in MySQL 3.2.1.
Purpose
This view displays the global privileges of the 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 | Whether to grant the SELECT privilege. |
| insert_priv | varchar(1) | NO | Whether to grant the INSERT privilege. |
| update_priv | varchar(1) | NO | Whether to grant the UPDATE privilege. |
| delete_priv | varchar(1) | NO | Whether to grant the DELETE privilege. |
| create_priv | varchar(1) | NO | Whether to grant the CREATE privilege. |
| drop_priv | varchar(1) | NO | Whether to grant the DROP privilege. |
| reload_priv | varchar(1) | NO | Whether to grant the RELOAD privilege. Currently, this field is not used. |
| shutdown_priv | varchar(1) | NO | Whether to grant the SHUTDOWN privilege. Currently, this field is not used. |
| process_priv | varchar(1) | NO | Whether to grant the PROCESS privilege. |
| file_priv | varchar(1) | NO | Whether to grant the FILE privilege. Currently, this field is not used. |
| grant_priv | varchar(1) | NO | Whether to grant the GRANT privilege. |
| reference_priv | varchar(1) | NO | Reserved. |
| index_priv | varchar(1) | NO | Whether to grant the INDEX privilege. |
| alter_priv | varchar(1) | NO | Whether to grant the ALTER privilege. |
| show_db_priv | varchar(1) | NO | Whether to grant the SHOW DATABASES privilege. |
| super_priv | varchar(1) | NO | Whether to grant the SUPER privilege. |
| create_tmp_table_priv | varchar(1) | NO | Whether to grant the privilege to create temporary tables. (Not used.) |
| lock_tables_priv | varchar(1) | NO | Whether to grant the LOCK TABLES privilege. Currently, this field is not used. |
| execute_priv | varchar(1) | NO | Whether to grant the privilege to execute stored procedures. Currently, this field is not used. |
| repl_slave_priv | varchar(1) | NO | Reserved. |
| repl_client_priv | varchar(1) | NO | Reserved. |
| create_view_priv | varchar(1) | NO | Whether to grant the privilege to create views. |
| show_view_priv | varchar(1) | NO | Whether to grant the SHOW CREATE VIEW privilege. |
| create_routine_priv | varchar(1) | NO | Whether to grant the privilege to create stored procedures. Currently, this field is not used. |
| alter_routine_priv | varchar(1) | NO | Whether to grant the privilege to modify stored procedures. Currently, this field is not used. |
| create_user_priv | varchar(1) | NO | Whether to grant the CREATE USER privilege. |
| event_priv | varchar(1) | NO | Whether to grant the privilege to create, modify, and drop events. Currently, this field is not used. |
| trigger_priv | varchar(1) | NO | Whether to grant the privilege to operate triggers. Currently, this field is not used. |
| create_tablespace_priv | varchar(1) | NO | Whether to grant the privilege to create tablespaces. Currently, this field is not used. |
| ssl_type | varchar(10) | NO | Reserved. |
| ssl_cipher | varchar(1024) | NO | Reserved. |
| x509_issuer | varchar(1024) | NO | Reserved. |
| x509_subject | varchar(1024) | NO | Reserved. |
| max_questions | bigint(20) | NO | The maximum number of queries that a user can execute per hour. (Not used.) |
| max_updates | bigint(20) | NO | The maximum number of updates that a user can execute per hour. Currently, this field is not used. |
| max_connections | bigint(20) | NO | The maximum number of connections that a user can receive per hour. Currently, this field is not used. |
| max_user_connections | bigint(20) | NO | The maximum number of concurrent connections that can be requested. Currently, this field is not used. |
| plugin | varchar(1024) | NO | Reserved. |
| authentication_string | varchar(1024) | NO | Reserved. |
| password_expired | varchar(1) | NO | Whether the user password has expired. Currently, this field is not used. |
| account_locked | varchar(1) | NO | Whether the user account is locked. |
| drop_database_link_priv | varchar(1) | NO | Whether to grant the privilege to delete database links. |
| create_database_link_priv | varchar(1) | NO | Whether to grant the privilege to create database links. |
| create_role_priv | varchar(1) | NO | Whether to grant the privilege to create roles. |
| drop_role_priv | varchar(1) | NO | Whether to grant the privilege to drop roles. |
Sample query
Query the global privileges of the test2 user.
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