SHOW PRIVILEGES

This statement shows a list of assignable privileges in TiDB. It is a static list, and does not reflect the privileges of the current user.

Synopsis

ShowPrivilegesStmt

SHOW PRIVILEGES - 图1

  1. ShowPrivilegesStmt ::=
  2. "SHOW" "PRIVILEGES"

Examples

  1. SHOW PRIVILEGES;
  1. +---------------------------------+---------------------------------------+-------------------------------------------------------+
  2. | Privilege | Context | Comment |
  3. +---------------------------------+---------------------------------------+-------------------------------------------------------+
  4. | Alter | Tables | To alter the table |
  5. | Alter routine | Functions,Procedures | To alter or drop stored functions/procedures |
  6. | Config | Server Admin | To use SHOW CONFIG and SET CONFIG statements |
  7. | Create | Databases,Tables,Indexes | To create new databases and tables |
  8. | Create routine | Databases | To use CREATE FUNCTION/PROCEDURE |
  9. | Create role | Server Admin | To create new roles |
  10. | Create temporary tables | Databases | To use CREATE TEMPORARY TABLE |
  11. | Create view | Tables | To create new views |
  12. | Create user | Server Admin | To create new users |
  13. | Delete | Tables | To delete existing rows |
  14. | Drop | Databases,Tables | To drop databases, tables, and views |
  15. | Drop role | Server Admin | To drop roles |
  16. | Event | Server Admin | To create, alter, drop and execute events |
  17. | Execute | Functions,Procedures | To execute stored routines |
  18. | File | File access on server | To read and write files on the server |
  19. | Grant option | Databases,Tables,Functions,Procedures | To give to other users those privileges you possess |
  20. | Index | Tables | To create or drop indexes |
  21. | Insert | Tables | To insert data into tables |
  22. | Lock tables | Databases | To use LOCK TABLES (together with SELECT privilege) |
  23. | Process | Server Admin | To view the plain text of currently executing queries |
  24. | Proxy | Server Admin | To make proxy user possible |
  25. | References | Databases,Tables | To have references on tables |
  26. | Reload | Server Admin | To reload or refresh tables, logs and privileges |
  27. | Replication client | Server Admin | To ask where the slave or master servers are |
  28. | Replication slave | Server Admin | To read binary log events from the master |
  29. | Select | Tables | To retrieve rows from table |
  30. | Show databases | Server Admin | To see all databases with SHOW DATABASES |
  31. | Show view | Tables | To see views with SHOW CREATE VIEW |
  32. | Shutdown | Server Admin | To shut down the server |
  33. | Super | Server Admin | To use KILL thread, SET GLOBAL, CHANGE MASTER, etc. |
  34. | Trigger | Tables | To use triggers |
  35. | Create tablespace | Server Admin | To create/alter/drop tablespaces |
  36. | Update | Tables | To update existing rows |
  37. | Usage | Server Admin | No privileges - allow connect only |
  38. | BACKUP_ADMIN | Server Admin | |
  39. | RESTORE_ADMIN | Server Admin | |
  40. | SYSTEM_USER | Server Admin | |
  41. | SYSTEM_VARIABLES_ADMIN | Server Admin | |
  42. | ROLE_ADMIN | Server Admin | |
  43. | CONNECTION_ADMIN | Server Admin | |
  44. | PLACEMENT_ADMIN | Server Admin | |
  45. | DASHBOARD_CLIENT | Server Admin | |
  46. | RESTRICTED_TABLES_ADMIN | Server Admin | |
  47. | RESTRICTED_STATUS_ADMIN | Server Admin | |
  48. | RESTRICTED_VARIABLES_ADMIN | Server Admin | |
  49. | RESTRICTED_USER_ADMIN | Server Admin | |
  50. | RESTRICTED_CONNECTION_ADMIN | Server Admin | |
  51. | RESTRICTED_REPLICA_WRITER_ADMIN | Server Admin | |
  52. | RESOURCE_GROUP_ADMIN | Server Admin | |
  53. +---------------------------------+---------------------------------------+-------------------------------------------------------+
  54. 49 rows in set (0.00 sec)

MySQL compatibility

The SHOW PRIVILEGES statement in TiDB is fully compatible with MySQL. If you find any compatibility differences, report a bug.

See also