I made a dump of a MySQL DB with mysqldump and am now trying to restore it to my DigitalOcean managed DB using the doadmin user and I get this error:
ERROR 1227 (42000) at line 18: Access denied; you need (at least one of) the SUPER, SYSTEM_VARIABLES_ADMIN or SESSION_VARIABLES_ADMIN privilege(s) for this operation
Line 18 of the SQL dump is this:
SET @@SESSION.SQL_LOG_BIN= 0;
I comment that line out by prepending # to that and then got an error on these lines:
SET @@GLOBAL.GTID_PURGED=/*!80000 '+'*/ '060bc47a-c804-11ec-a3fa-b269afb00e36:1-4029';
SET @@SESSION.SQL_LOG_BIN = @MYSQLDUMP_TEMP_LOG_BIN;
Manually commenting out the lines is fine for MySQL dumps that are a few MB big but it’s a lot trickier with a multi GB DB dump.
Any ideas?
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!
Accepted Answer
Hi @jimwigginton,
the command you’ve used:
- sed 's/SET @@SESSION.SQL_LOG_BIN.*//' -i backup.sql
- sed 's/SET @@GLOBAL.GTID_PURGED.*//' -i backup.sql
I’m glad it has helped you. Having said that, yes the doadmin user on the Managed platform does not have permissions like a root user. This is because the product is managed at it has limitations. Imagine every person having root access to the Managed Database.
I was somewhat able to get around this by doing this:
sed 's/SET @@SESSION.SQL_LOG_BIN.*//' -i backup.sql
sed 's/SET @@GLOBAL.GTID_PURGED.*//' -i backup.sql
I still think it’s weird that the default doadmin user doesn’t have the maximum possible permissions…
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.