How to know if a mysql user has all (or some) privileges on a certain DB?

Of course, I don't ask how to do so with phpmyadmin, rather, with the mysql CLI.

I aim to gather as much as basic data on a certain user but the most important for me is to understand the degree this user is associated with the given database (which has the exact same name as the user name, in this case - both the user and the db, are called test).

Edit for PuzzledCuber:

That's my output for show grants for 'test'@'%';:

| Grants for test@localhost                              |
| GRANT USAGE ON *.* TO 'test'@'localhost'               |
| GRANT ALL PRIVILEGES ON `test`.* TO 'test'@'localhost' |

Why is the second row (GRANT ALL...) different than the first row (GRANT USAGE...)?


>show grants for 'user'@'%';
Thie explains how to check users and their privileges:

This shows the different permission types and how to grant them:

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.