SHOW CATALOGS
MariaDB starting with 11.8
Catalog support is planned for 11.8.
Syntax
SHOW CATALOGS [LIKE 'pattern' | WHERE expr]
Contents
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 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 have 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 | | +--------------+--------------------+