Unable to import database from another managed database


I’m trying to set up a staging Managed Database

So far I have Exported all my databases from the production Managed DB to an SQL file using mysqldump but when I try to import to the staging I stumble upon an error saying I need at least one super-user privileges (I Have used the default user doadmin) I even tried including the cert that was given to me but it didn’t help at all

Now I understand that DO won’t grant super-user access but It just doesn’t make sense why I can’t do this process

do I need to Include some special flag during export to overcome this issue?

 mysql -u doadmin -p   -h Staging-DB -P 25060 newDatabase < exportedDatabase.sql
Access denied; you need (at least one of) the SUPER, SYSTEM_VARIABLES_ADMIN or SESSION_VARIABLES_ADMIN privilege(s) for this operation

And here’s the export command I executed

mysqldump -u doadmin -p -h Prod-DB -P 25060 database > database.sql


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
February 12, 2020
Accepted Answer

Hi there @omercohen,

I believe that right before the Access denied; statement, you should have an Error Number followed by the exact line in the .sql file which is causing this error. Usually, it should look something like this:

ERROR 1227 (42000) at line 123: Access denied; ...

What you could do is open the .sql file on that line and remove the SET @@SESSION. or the SET @@GLOBAL. statements or comment them out with --. Then you should be able to run the import as normal.

Feel free to share the exact line from the .sql dump which is causing the problem here and I could try to advise you further.

Regards, Bobby

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