All Products
Search
Document Center

AnalyticDB:DROP DATABASE

Last Updated:Mar 28, 2026

Deletes a database from an AnalyticDB for MySQL cluster.

Syntax

DROP DATABASE db_name [CASCADE]

Parameters

ParameterDescription
db_nameThe name of the database to delete.
CASCADEDrops the database and all objects it contains, including tables, views, and materialized views. Without CASCADE, all tables, views, and materialized views must be deleted from the database before you can drop it.

Usage notes

Important

Only clusters running V3.2.1 or later support the CASCADE keyword. On earlier clusters, delete all tables, views, and materialized views from the database before running DROP DATABASE.

To check your cluster version or upgrade to V3.2.1 or later, see Update the minor version of a cluster.

Examples

Drop the adb_demo database (the database must contain no tables, views, or materialized views):

DROP DATABASE adb_demo;

Drop the adb_demo1 database and all objects it contains:

DROP DATABASE adb_demo1 CASCADE;