Which databases do I have permissions for

How can I find which databases I have at least read access to in basic SQL, MySQL or PHP?

+5
source share
3 answers

There is a command in MySQL that can show you all the permissions that you have. Team:

SHOW GRANTS;

This will give you a result similar to:

root @ (none) ~> show grants;
+ ------------------------------------------------- -------------------- +
| Grants for root @ localhost                                            |
+ ------------------------------------------------- -------------------- +
| GRANT ALL PRIVILEGES ON *. * TO 'root' @ 'localhost' WITH GRANT OPTION |
+ ------------------------------------------------- -------------------- +
1 row in set (0.00 sec)

.

+5

MySQL

SHOW DATABASES;

SHOW DATABASES;, , . - ?

+1

You can also try connecting to the database using phps mysql_connect (...), will quickly tell you if you have access.

+1
source

All Articles