SHOW CATALOGS

You are viewing an old version of this article. View the current version here.

Syntax

SHOW CATALOGS
    [LIKE 'pattern' | WHERE expr]

Description

SHOW CATALOGS lists the catalogs on the MariaDB server host. The LIKE clause, if present on its own, indicates which catalog names to match. The WHERE and LIKE clauses can be given to select rows using more general conditions, as discussed in Extended SHOW.

You see only use SHOW CATALOGS have the CATALOG privilege. Only users of the 'def' schema can have this privilege.

If the server was started with the --skip-show-database option, you cannot use this statement at all unless you have the SHOW DATABASES privilege.

The list of results returned by SHOW CATALOGS is based on directories in the data directory, which is how MariaDB implements catalogs. It only list directories that has a mysql directory.

The Information Schema catalogs table also contains catalog information.

Examples

+---------+--------------------+
| Catalog | Comment            |
+---------+--------------------+
| c1      | This is catalog c1 |
| cat2    |                    |
| def     | default catalog    |
+---------+--------------------+
SHOW CATALOGS LIKE 'c%';
+--------------+--------------------+
| Catalog (c%) | Comment            |
+--------------+--------------------+
| c1           | This is catalog c1 |
| cat2         |                    |
+--------------+--------------------+

See Also

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.