Bulk insert to MySql Managed Database via LOAD DATA LOCAL INFILE

Hi, migrating to DigitalOcean from other cloud providers. Using a couple of webservers which connect to a Managed Database (MySql).

As part of our workflow, every now and then we need to upload a large batch of data into one of the tables, and on AWS/GCP were able to put it in a csv on the webserver, then insert it all in one go using LOAD DATA LOCAL INFILE

I’m getting various errors, and working through them one by one, but I’ve realised that in Mysql 8.0 if LOCAL_INFILE is disabled on either the client OR server then it won’t work. Running SHOW GLOBAL VARIABLES LIKE 'local_infile'; returns false :-(

The solution would be to run SET GLOBAL local_infile = 1; but I get the error: Error Code: 1227. Access denied; you need (at least one of) the SUPER or SYSTEM_VARIABLES_ADMIN privilege(s) for this operation (even if run by doadmin user.)

Can a DigitalOcean admin/employee can set that global variable for me? Or some other way to solve it? Or am I going to have to use some other less-optimal method?

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

I have the same problem

Hi there,

Thanks for reaching out to DigitalOcean Support and we apologies for the inconvenience you are having loading data. But since the database is managed on our end it isn’t possible for us to grant the super admin permission for the cluster due to stability reasons.

You can refer this tool mentioned below in link using which you can use to convert and transform big files of CSV to MYSQL.

Regards, DigitalOcean Support