> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cockroachlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SHOW DATABASES

The `SHOW DATABASES` [statement](/docs/stable/sql-statements.md) lists all databases in the CockroachDB cluster.

## Synopsis

![show\_databases syntax diagram](https://mintcdn.com/cockroachlabs/UZNSFbmU2EwEm6G5/images/sql-diagrams/common/show_databases.svg?fit=max\&auto=format\&n=UZNSFbmU2EwEm6G5\&q=85\&s=37dbd6e51b6c9f3e0c3313d8628a15b4)

## Required privileges

The user must be granted the `CONNECT` [privilege](/docs/stable/security-reference/authorization.md#managing-privileges) to specific databases in order to list those databases in the CockroachDB cluster.

## Example

### Show databases

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> SHOW DATABASES;
```

```
  database_name | owner | primary_region | secondary_region | regions | survival_goal
----------------+-------+----------------+------------------+---------+----------------
  defaultdb     | root  | NULL           | NULL             | {}      | NULL
  movr          | demo  | NULL           | NULL             | {}      | NULL
  postgres      | root  | NULL           | NULL             | {}      | NULL
  system        | node  | NULL           | NULL             | {}      | NULL
(4 rows)
```

Alternatively, within the built-in SQL shell, you can use the `\l` [shell command](/docs/stable/cockroach-sql.md#commands) to list all databases:

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> \l
```

```
  database_name | owner | primary_region | secondary_region | regions | survival_goal
----------------+-------+----------------+------------------+---------+----------------
  defaultdb     | root  | NULL           | NULL             | {}      | NULL
  movr          | demo  | NULL           | NULL             | {}      | NULL
  postgres      | root  | NULL           | NULL             | {}      | NULL
  system        | node  | NULL           | NULL             | {}      | NULL
(4 rows)
```

### Show databases with comments

You can use [`COMMENT ON`](/docs/stable/comment-on) to add comments on a database.

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
COMMENT ON DATABASE movr IS 'This database holds information about users, vehicles, and rides.';
```

To view a database's comments:

```sql theme={"theme":{"light":"catppuccin-mocha","dark":"catppuccin-mocha"}}
> SHOW DATABASES WITH COMMENT;
```

```
   database_name | owner | primary_region | secondary_region | regions | survival_goal |                              comment
----------------+-------+----------------+------------------+---------+---------------+--------------------------------------------------------------------
  defaultdb     | root  | NULL           | NULL             | {}      | NULL          | NULL
  movr          | demo  | NULL           | NULL             | {}      | NULL          | This database holds information about users, vehicles, and rides.
  postgres      | root  | NULL           | NULL             | {}      | NULL          | NULL
  system        | node  | NULL           | NULL             | {}      | NULL          | NULL
(4 rows)
```

For more information, see [`COMMENT ON`](/docs/stable/comment-on).

## Preloaded databases

New clusters and existing clusters [upgraded](/docs/stable/upgrade-cockroach-version.md) to v26.3 or later will include auto-generated databases, with the following purposes:

* The empty `defaultdb` database is used if a client does not specify a database in the [connection parameters](/docs/stable/connection-parameters.md).
* The `movr` database contains data about users, vehicles, and rides for the vehicle-sharing app [MovR](/docs/stable/movr.md) (only when the cluster is started using the [`demo` command](/docs/stable/cockroach-demo)).
* The empty `postgres` database is provided for compatibility with PostgreSQL client applications that require it.
* The `system` database contains CockroachDB metadata and is read-only.

All databases except for the `system` database can be [deleted](/docs/stable/drop-database.md) if they are not needed.

> [!CAUTION]
>
> Do not query the `system` database directly. Instead, use objects within the [system catalogs](/docs/stable/system-catalogs.md).

## See also

* [`COMMENT ON`](/docs/stable/comment-on)
* [`SHOW SCHEMAS`](/docs/stable/show-schemas)
* [Information Schema](/docs/stable/information-schema.md)
* [SQL Statements](/docs/stable/sql-statements.md)
