Outdated Version

You are viewing an older version of this section. View current production version.

SHOW DATABASES

Shows the list of databases that exist on this MemSQL instance.

SHOW DATABASES [EXTENDED]
[LIKE 'pattern']

Notes

  • The EXTENDED suffix is a MemSQL-only extension that displays extra information about each database.
  • This command must be run on the master aggregator or a child aggregator node (see Node Requirements for MemSQL Commands).

Output (EXTENDED option)

Column Description
Database Name of a database in the MemSQL instance
Commits Number of committed transactions
Role Database replication role
State Current state (:ref:database_states)
Position Current position in the transaction log, formatted as <LogFileId>:<ByteOffsetInLogFile>
Details Optional message about the current state
AsyncSlaves Number of currently attached asynchronous replicas
SyncSlaves Number of currently attached synchronous replicas

Examples

memsql> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| memsql             |
| test               |
+--------------------+
3 rows in set (0.00 sec)


memsql> SHOW DATABASES EXTENDED;
+--------------------+---------+-------------+---------------------+----------+-------------------------+-------------+------------+
| Database           | Commits | Role        | State               | Position | Details                 | AsyncSlaves | SyncSlaves |
+--------------------+---------+-------------+---------------------+----------+-------------------------+-------------+------------+
| information_schema |    NULL | NULL        | NULL                | NULL     | NULL                    | NULL        | NULL       |
| memsql             |       3 | master      | online              | 0:183    | NULL                    | 0           | 0          |
| foo                |     112 | master      | online              | 1:202    | NULL                    | 1           | 0          |
| bar                |    NULL | master      | recovering snapshot | 2:89123  | Recovery progress 17.2% | 0           | 1          |
| example_slave      |      37 | async slave | replicating         | 0:8870   | NULL                    | 0           | 0          |
+--------------------+---------+-------------+---------------------+----------+-------------------------+-------------+------------+