Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Deleting backup failed in Cloud SQL

Hi,

I'm using google cloud sql with mysql 8.0. I've created an on demand backup in one of my projects and tried to delete it. However every time I run a delete on the command line or through the GCP web page it says the deletion failed.

e.g:

gcloud sql backups delete <backup_id>  --instance <instance_id>
The backup will be deleted. You cannot undo this action.

Do you want to continue (Y/n)?  y

Deleting backup run...failed.                                                                                                                                       
ERROR: (gcloud.sql.backups.delete) [UNKNOWN]

It shows like this on the WEB UI. 

rfPatrick_0-1682657976126.png

Has anyone run into this error? How did you delete the backup?

0 1 372
1 REPLY 1

To delete a backup, you should follow these steps:

  1. First, make sure you have the correct permissions on your Google Cloud Platform (GCP) project. You must have the "Cloud SQL Admin" role or a custom role with the appropriate permissions.

  2. Ensure that you have the latest version of the gcloud command-line tool. Update it using the following command:

    gcloud components update

  1. List the available backups for your Cloud SQL instance to find the backup you want to delete:

    gcloud sql backups list --instance=INSTANCE_NAME

Replace INSTANCE_NAME with the name of your Cloud SQL instance.

  1. Identify the backup ID of the backup you want to delete.

  2. Delete the backup using the following command:

   gcloud sql backups delete BACKUP_ID --instance=INSTANCE_NAME

Replace BACKUP_ID with the backup ID from step 4, and INSTANCE_NAME with the name of your Cloud SQL instance.