doctl Verified current stable Not installed? Cloud Infrastructure

Doctl / Delete Database Cluster

Delete Database Cluster

Deletes a specified database cluster in the DigitalOcean environment.

$
Terminal
doctl d rm <database_id>

When To Use

When decommissioning or repurposing a database cluster within the cloud infrastructure.

Pro Tip

Database deletions are irreversible; confirm the loss of all associated data before proceeding.

Warning

Destructive operation. Confirm the target path and keep a backup before executing.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
doctl d rm <database_id>

Terminal Output

Expected runtime feedback

Simulated preview
>
Output
$ doctl databases delete 123456

Are you sure you want to delete the database cluster 123456? (y/n): y

Deleting database cluster 123456...

Success! Database cluster 123456 has been deleted.

Anatomy of Output

Understanding the result

Deleting database cluster: <database_id>... Output Status

Indicates the start of the deletion process.

Successfully deleted database cluster: <database_id>. Deletion Status

Confirms removal of the database cluster.

run 'doctl [[d|databases]] [[ls|list]]' to verify deletion. Next Steps

Advises the user on verifying that the cluster no longer exists.

Troubleshooting

Common pitfalls

Error: Database cluster <database_id> not found

Solution: Ensure the provided database identifier is correct.

Error: Cannot delete the cluster; it is in use by applications

Solution: Detach or decommission any applications using the cluster before deletion.

Error: Insufficient permission to delete the cluster

Solution: Verify that your API token has rights to perform deletion operations.

Command Breakdown

What each part is doing

doctl
Base Command
The executable that performs this operation. Here it runs Doctl before the shell applies any redirect operators.
d
d|databases
The value supplied for d|databases.
rm
rm|delete
The value supplied for rm|delete.
<database_id>
database id
The value supplied for database id.

How To Run

Execution path

  1. Step 1

    Run `doctl databases delete <database_id>` in your terminal.

  2. Step 2

    Confirm the deletion by typing 'y' when prompted.

Alternative Approaches

Comparable commands in other tools

Alternative cloud infrastructure tools for the same job.