SHOW-DATABASES
SHOW-DATABASESβ
Nameβ
SHOW DATABASES
Descriptionβ
This statement is used to display the currently visible db
grammar:
SHOW DATABASES [FROM catalog] [filter expr];
illustrate:
SHOW DATABASES
will get all database names from current catalog.SHOW DATABASES FROM catalog
will all database names from the catalog named 'catalog'.SHOW DATABASES filter_expr
will get filtered database names from current catalog.SHOW DATABASES FROM catalog filter_expr
is not support yet.
Exampleβ
Display all the database names from current catalog.
SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| test |
| information_schema |
+--------------------+Display all database names from the catalog named 'hms_catalog'.
SHOW DATABASES from hms_catalog;
+---------------+
| Database |
+---------------+
| default |
| tpch |
+---------------+Display the filtered database names from current catalog with the expr 'like'.
SHOW DATABASES like 'infor%';
+--------------------+
| Database |
+--------------------+
| information_schema |
+--------------------+
Keywordsβ
SHOW, DATABASES