For the current registered user, you can use SHOW DATABASES; . But if the user has the SHOW DATABASES; privilege SHOW DATABASES; , he will be able to see all the databases, even if he does not have access to it. ( link )
Assuming you read access to the mysql.db table, you can use:
SELECT * FROM mysql.db WHERE User="dimitris";
This will return the result set with Host (e.g. localhost ), Db (e.g. somedatabase ), User (e.g. dimitris ) and privileges for this database ( Select_priv , Update_priv , etc.)
Lekensteyn
source share