Using SHOW to list all databases on a server
To show a list of all of the databases on a server that the current user is allowed to see, use the SHOW DATABASES
command as in the following example:
MariaDB [(none)]> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | dbt3_s001 | | flightstats | | ham | | information_schema | | isfdb | | lds_scriptures | | library | | mysql | | performance_schema | | test | | wikidb | +--------------------+ 11 rows in set (0.00 sec) MariaDB [(none)]>
The preceding example is from my personal install of MariaDB; the databases listed when you run the command will almost assuredly be different. This command is useful especially if you're given access to an existing MariaDB database server and want to see what databases are available to you, or if you can't quite remember what a specific database was named...