Delete a database
Use the influxctl
CLI
or the Management HTTP API to create a database in your InfluxDB Cloud Dedicated cluster.
Deleting a database cannot be undone
Once a database is deleted, data stored in that database cannot be recovered.
Cannot reuse database names
After a database is deleted, you cannot reuse the same name for a new database.
If you haven’t already, download and install the
influxctl
CLI, and then configure aninfluxctl
connection profile for your cluster.In your terminal, run the
influxctl database delete
command and provide the following:- Name of the database to delete
Confirm that you want to delete the database.
influxctl database delete DATABASE_NAME
This example uses cURL to send a Management HTTP API request, but you can use any HTTP client.
If you haven’t already, follow the instructions to install cURL for your system.
In your terminal, use cURL to send a request to the following InfluxDB Cloud Dedicated endpoint:
DELETE https://console.influxdata.com/api/v0/accounts/ACCOUNT_ID/clusters/CLUSTER_ID/databases/DATABASE_NAME
In the URL, provide the following:
ACCOUNT_ID
: The ID of the account that the cluster belongs to (see how to list cluster details).CLUSTER_ID
: The ID of the cluster that you want to manage (see how to list cluster details).DATABASE_NAME
: The name of the database that you want to delete (see how to list databases).
Provide the following request headers:
Accept: application/json
to ensure the response body is JSON contentAuthorization: Bearer
and a Management API token for your cluster (see how to create a management token for Management API requests).
Specify the
DELETE
request method.
The following example shows how to use the Management API to delete a database:
curl \
--location "https://console.influxdata.com/api/v0/accounts/ACCOUNT_ID/clusters/CLUSTER_ID/databases/DATABASE_NAME" \
--request DELETE \
--header "Accept: application/json" \
--header "Authorization: Bearer MANAGEMENT_TOKEN"
Replace the following in your request:
ACCOUNT_ID
: the ID of the InfluxDB Cloud Dedicated account to create the database forCLUSTER_ID
: the ID of the InfluxDB Cloud Dedicated cluster to create the database forMANAGEMENT TOKEN
: a management token for your InfluxDB Cloud Dedicated clusterDATABASE_NAME
: your InfluxDB Cloud Dedicated database
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.