DBAtlas · Database operations atlas

3948: Loading local data is disabled; this must be enabled on both the client and server sides

MySQL

What does it mean?

You tried to load data from a client-side file with LOAD DATA LOCAL INFILE, but the feature is disabled on the client and/or server side. For security reasons LOCAL is disabled by default in MySQL 8.

Why does it happen?

The local_infile system variable is OFF on the server and/or the client driver has not enabled LOCAL INFILE. The feature is restricted by default because it can allow a malicious server to read client files.

How to fix it

If it is really needed, enable it on both sides: on the server SET GLOBAL local_infile = 1; on the client enable the driver's LOCAL INFILE flag (e.g. the allowLoadLocalInfile connection option / --local-infile=1). From a security standpoint, the preferred approach is to place the file on the server and use LOAD DATA INFILE without LOCAL, or use bulk INSERT/import tools. Disable local_infile again when you are done.

Open in DBAtlas →

More from this engine