doc-exports/docs/dli/sqlreference/dli_08_0074.html
Su, Xiaomeng 76a5b1ee83 dli_sqlreference_20240227
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
Co-committed-by: Su, Xiaomeng <suxiaomeng1@huawei.com>
2024-03-27 22:02:33 +00:00

4.8 KiB

Viewing All Databases

Function

This syntax is used to query all current databases.

Syntax

1
SHOW [DATABASES | SCHEMAS] [LIKE regex_expression];

Keywords

None

Parameters

Table 1 Parameter

Parameter

Description

regex_expression

Database name

Precautions

Keyword DATABASES is equivalent to SCHEMAS. You can use either of them in this statement.

Example

View all the current databases.

1
SHOW DATABASES;

View all databases whose names start with test.

1
SHOW DATABASES LIKE "test.*";