"Waiting for backup lock" when altering table in managed MySQL database

I’m trying to run a migration and the process for an alter table command is locked with show processlist giving its state as Waiting for backup lock

The text seems kind of self explanatory, there must be a backup happening.

Unfortunately I can’t see anything in the control panel that refers to backups, such as what time they happen, logs of how long they take or anyway to be able to identify if one is happening.

How can I change when backups occur?

How can I know if a backup is running before attempting to run some code so I don’t hit this problem again?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
January 18, 2023

Hi there,

To verify if this was indeed a backup, you can use the DigitalOcean API and send a GET request to /v2/databases/$DATABASE_ID/backups which will return a list of your database backups and the time they were created:

What you could also do is to change your maintenance window by sending a PUT request to /v2/databases/$DATABASE_ID/maintenance:

Hope that this helps!



Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel