View databases

2024-04-19 08:42:50  Updated

This topic describes how to view databases in the MySQL mode of OceanBase Database by using an SQL statement.

Procedure

  1. Log on to a MySQL tenant of the cluster.

  2. Use the SHOW DATABASES statement to view the information about databases under the MySQL tenant.

    Here is an example:

    obclient> SHOW DATABASES;
    +--------------------+
    | Database           |
    +--------------------+
    | oceanbase          |
    | information_schema |
    | mysql              |
    | test               |
    +--------------------+
    3 rows in set
    

    where

    • information_schema allows you to access the database metadata. This is a built-in database in MySQL.

    • oceanbase stores the system tables of OceanBase Database.

    • mysql stores the database users, privilege settings, and keywords.

    • test indicates a custom database created by the current user.

Contact Us