PHP - get list of database names
6 answers
In MySQL, the prompt SHOW DATABASES
does what you want.
You can run this command as a query from PDO or MySQL's own PHP library and read the returned rows. Imagine this is a common choice.
You will only see the databases that the account used to connect to MySQL can see.
0
source to share