SHOW {DATABASES | SCHEMAS}
[LIKE 'pattern' | WHERE expr]
The SHOW DATABASES statement lists the databases on the MySQL server. The optional LIKE clause filters database names by pattern, and the WHERE clause lets you apply more general selection conditions.
By default, you see only those databases for which you have some privilege, unless you have the global SHOW DATABASES privilege.
If the server is started with the --skip-show-database option, SHOW DATABASES doesn’t work unless you have the SHOW DATABASES privilege.
Database information is also available through the INFORMATION_SCHEMA.SCHEMATA view.
For more information, see the MySQL documentation: SHOW DATABASES Statement.