Question

How to disable SQL_REQUIRE_PRIMARY_KEY in digital ocean manged database for mysql?

How to disable SQL_REQUIRE_PRIMARY_KEY in digital ocean manged database for mysql globaly?

Subscribe
Share

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

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.

Hi,

Our engineer team has updated API documentation to make database configuration changes via API; you will now be able to disable sql_require_primary_key using API.

To check database configuration check the below link: https://docs.digitalocean.com/reference/api/api-reference/#operation/get_database_config

To update database configuration check the below link: https://docs.digitalocean.com/reference/api/api-reference/#operation/patch_database_config ​​​​​​​

To create “$DIGITALOCEAN_TOKEN” check the below link: https://docs.digitalocean.com/reference/api/create-personal-access-token/ ​​​​​​​

To fetch “$database_cluster_uuid” check the below link: https://docs.digitalocean.com/reference/api/api-reference/#operation/list_database_clusters

You can reach out to support if you are seeing any errors while changing database configuration using API https://docs.digitalocean.com/support/

I hope this helps!

Regards, Rajkishore

Hi @ajaypatel,

You can reach out to DO support to disable global sql_require_primary_key for your MySQL managed database.

If you need to disable it on session level, you can execute the below command.

SET SESSION sql_require_primary_key = 0;

I hope this helps!

Regards, Rajkishore