I wonder how can I get the list of MySQL databases in PHP using PDO without having to connect to a database first ( I mean no dbname in dsn )?
Usually I used to use
You can use
show databases
or a query on the information_schema:
select schema_name from information_schema.schemata