How to alter System and Global Variables on Managed Database Instances

I am attempting to migrate from AWS to Digital Ocean but I have hit a brick wall with the managed databases. I cannot seem to find a way to alter the settings of the database instances like I can with AWS RDS service. This could be a serious problem in my attempts to migrate to DigitalOcean because the MySQL instance as configured is not compatible with the software I host due to some small settings that needs to be changed such as sql_require_primary_key which is set to ON an I need that Off. I cannot import my databases.

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
July 9, 2023

Hi there,

You can change the settings for your Managed Database clusters via the DigitalOcean API as described here:

The request would look as follows:

curl -X PATCH \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
  -d '{"config": {"sql_mode": "ANSI,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,STRICT_ALL_TABLES","sql_require_primary_key": true}}' \

Alternatively, you could use the doctl CLI to do that as well:

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

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

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

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

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