[MYSQL] How to see mysql user PRIVILEGES

There are commands to show all privileges of yours or other users.

Self PRIVILEGES
You can see your privileges using below query in mysql command prompt or sql window .
SHOW GRANTS FOR CURRENT_USER;
Make sure you are in correct databases where you want to check privileges.
it will display all the grants info about current user for the used database .
Example :

+——————————————————————————- ——————–+
| Grants for user@localhost |
+——————————————————————————- ——————–+
| GRANT USAGE ON *.* TO ‘user’@’localhost’ IDENTIFIED BY PASSWORD |
| GRANT SELECT, SHOW VIEW ON `DB`.* TO ‘user’@’localhost’ |
| GRANT ALL PRIVILEGES ON `DB`.`table1` TO ‘user’@’localhost’ |
| GRANT SELECT, INSERT ON `DB`.`table2` TO ‘user’@’localhost’ |
| GRANT ALL PRIVILEGES ON `DB`.`table3` TO ‘user’@’localhos t’ |
| GRANT ALL PRIVILEGES ON `DB`.`table4` TO ‘user’@ ‘localhost’ |
+——————————————————————————- ——————–+

Show Buttons
Hide Buttons