How to change max_sp_recursion_depth on managed MySQL database

I have created a stored procedure that uses recursion and so I need to set the max_sp_recursion_depth system variable in order for it to work. When I try setting it via the console, I get the following error:

set global max_sp_recursion_depth=1
[42000][1227] Access denied; you need (at least one of) the SUPER or SYSTEM_VARIABLES_ADMIN privilege(s) for this operation

I’ve also tried setting it using doctl but I get the following error:

doctl databases configuration update <cluster_id> -e "mysql" --config-json '{"max_sp_recursion_depth": 1}'
Error: PATCH<cluster_id>/config: 422 (request "<req_id>") the mask must be set with which fields are being updated

How can I change system variables on DigitalOcean Managed MySQL 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.

Site Moderator
Site Moderator badge
January 29, 2024
Accepted Answer

Heya @nathanaelg16,

You can’t set max_sp_recursion_depth as your user doesn’t have the permissions and this is a global setting. This means that configuring it will affect other users using the same instance as you.

My suggestion would be to contact DigitalOcean support and ask them if they can set it up for you however I can’t promise any answer on that.

You can reach them here:

Hope that helps! - KFSys.

Try DigitalOcean for free

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

Sign up

Featured on Community

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