#### 13.7.7.14 SHOW DATABASES Statement

[]()[]()

```
SHOW {DATABASES | SCHEMAS}
    [LIKE 'pattern' | WHERE expr]
```

[`SHOW DATABASES`](show-databases.html) lists the databases on the MySQL server host. [`SHOW SCHEMAS`](show-databases.html) is a synonym for [`SHOW DATABASES`](show-databases.html). The [`LIKE`](string-comparison-functions.html#operator_like) clause, if present, indicates which database names to match. The `WHERE` clause can be given to select rows using more general conditions, as discussed in [Section 26.8, “Extensions to SHOW Statements”](extended-show.html).

 You see only those databases for which you have some kind of privilege, unless you have the global [`SHOW DATABASES`](show-databases.html) privilege. You can also get this list using the [**mysqlshow**](mysqlshow.html) command.

 If the server was started with the [`--skip-show-database`](server-options.html#option_mysqld_skip-show-database) option, you cannot use this statement at all unless you have the [`SHOW DATABASES`](privileges-provided.html#priv_show-databases) privilege.

 MySQL implements databases as directories in the data directory, so this statement simply lists directories in that location. However, the output may include names of directories that do not correspond to actual databases.

 Database information is also available from the `INFORMATION_SCHEMA` [`SCHEMATA`](information-schema-schemata-table.html) table. See [Section 26.3.31, “The INFORMATION\_SCHEMA SCHEMATA Table”](information-schema-schemata-table.html).

Caution

 Because any static global privilege is considered a privilege for all databases, any static global privilege enables a user to see all database names with [`SHOW DATABASES`](show-databases.html) or by examining the [`SCHEMATA`](information-schema-schemata-table.html) table of `INFORMATION_SCHEMA`, except databases that have been restricted at the database level by partial revokes.

