Report this

What is the reason for this report?

Bulk insert to MySql Managed Database via LOAD DATA LOCAL INFILE

Posted on January 3, 2020

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?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.