This statement is used to display the currently visible database.
SHOW DATABASES [FROM <catalog>] [<filter_expr>];
** 1. <catalog>**
Corresponding catalog
** 2. <filter_expr>**
Filter by specified conditions
| Column | Description |
|---|---|
| Database | Database Name |
The user executing this SQL command must have at least the following permissions:
| Permissions | Object | Notes |
|---|---|---|
| SELECT_PRIV | Corresponding database | Requires read permission on the corresponding database |
Displays the names of all current databases.
SHOW DATABASES;
+--------------------+ | Database | +--------------------+ | test | | information_schema | +--------------------+
Will display all database names in hms_catalog.
SHOW DATABASES FROM hms_catalog;
+---------------+ | Database | +---------------+ | default | | tpch | +---------------+
Displays the names of all databases currently filtered by the expression like 'infor%'.
SHOW DATABASES like 'infor%';
+--------------------+ | Database | +--------------------+ | information_schema | +--------------------+