All pages
Powered by GitBook
1 of 1

Loading...

SHOW DATABASES

List databases on the MariaDB server. View the names of all databases available to the current user.

Syntax

Description

SHOW DATABASES lists the databases on the MariaDB server host.SHOW SCHEMAS is a synonym forSHOW DATABASES. The LIKE clause, if present on its own, indicates which database names to match. The WHERE and LIKE clauses can be given to select rows using more general conditions, as discussed in .

You see only those databases for which you have some kind of privilege, unless you have the global . You can also get this list using the command.

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

The list of results returned by SHOW DATABASES is based on directories in the data directory, which is how MariaDB implements databases. It's possible that output includes directories that do not correspond to actual databases.

The also contains database information.

Examples

See Also

This page is licensed: GPLv2, originally from

SHOW {DATABASES | SCHEMAS}
    [LIKE 'pattern' | WHERE expr]
Character Sets and Collations
  • Information Schema SCHEMATA Table

  • Extended SHOW
    SHOW DATABASES privilege
    mariadb-show
    SHOW DATABASES privilege
    Information Schema SCHEMATA table
    CREATE DATABASE
    ALTER DATABASE
    DROP DATABASE
    SHOW CREATE DATABASE
    fill_help_tables.sql
    SHOW DATABASES;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | mysql              |
    | performance_schema |
    | test               |
    +--------------------+
    SHOW DATABASES LIKE 'm%';
    +---------------+
    | Database (m%) |
    +---------------+
    | mysql         |
    +---------------+