How to view privileges

A statement that lists all users

      SELECT User, Host from mysql.user;
      

The result set

View User Privs image

The syntax of the SHOW GRANTS statement

      SHOW GRANTS [FOR user];
      

A statement that shows the privileges for a user from any host

      SHOW GRANTS FOR dba;
      

The result set

View User Privs image

A statement that shows the privileges for a user from a specific host

      SHOW GRANTS FOR mgs_user@localhost;
      

The result set

View User Privs image

A statement that shows the privileges for the current user

      SHOW GRANTS;
      

Description

Back