📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

system.databases



Provides metadata about all databases in the system, including their catalogs, names, unique IDs, owners, and drop timestamps.

See also: SHOW DATABASES

SELECT * FROM system.databases; ┌─────────────────────────────────────────────────────────────────────────────────────────────┐ │ catalog │ name │ database_id │ owner │ dropped_on │ ├─────────┼────────────────────┼─────────────────────┼──────────────────┼─────────────────────┤ │ defaultsystem4611686018427387905NULLNULL │ │ default │ information_schema │ 4611686018427387906NULLNULL │ │ defaultdefault1NULLNULL │ │ default │ doc │ 2597 │ account_admin │ NULL │ └─────────────────────────────────────────────────────────────────────────────────────────────┘

To show the schema of system.databases, use DESCRIBE system.databases:

DESCRIBE system.databases; ┌───────────────────────────────────────────────────────────┐ │ Field │ Type │ NullDefault │ Extra │ ├─────────────┼─────────────────┼────────┼─────────┼────────┤ │ catalog │ VARCHARNO'' │ │ │ name │ VARCHARNO'' │ │ │ database_id │ BIGINT UNSIGNED │ NO0 │ │ │ owner │ VARCHAR │ YES │ NULL │ │ │ dropped_on │ TIMESTAMP │ YES │ NULL │ │ └───────────────────────────────────────────────────────────┘

Was this page helpful?