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

system.databases_with_history



Records all databases, including active and dropped ones. It shows each database's catalog, name, unique ID, owner (if specified), and the deletion timestamp (NULL if still active).

See also: SHOW DROP DATABASES

SELECT * FROM system.databases_with_history; ┌────────────────────────────────────────────────────────────────────────────────────────────────────┐ │ catalog │ name │ database_id │ owner │ dropped_on │ ├─────────┼────────────────────┼─────────────────────┼──────────────────┼────────────────────────────┤ │ defaultsystem4611686018427387905NULLNULL │ │ default │ information_schema │ 4611686018427387906NULLNULL │ │ defaultdefault1NULLNULL │ │ default │ my_db │ 114NULL2024-11-15 02:44:46.207120 │ └────────────────────────────────────────────────────────────────────────────────────────────────────┘

Was this page helpful?