Bug #91872 MySQL Workbench 8.0 restricts usage of LOAD DATA LOCAL INFILE
Submitted: 2 Aug 2018 12:46 Modified: 3 Aug 2018 12:01
Reporter: Rodrigo Viegas Viegas Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench Severity:S1 (Critical)
Version:8.0 OS:Windows (Windows 10)
Assigned to: CPU Architecture:x86 (Intel Core i7)
Tags: error 1148, LOAD DATA LOCAL INFILE, workbench

[2 Aug 2018 12:46] Rodrigo Viegas Viegas
Description:
After upgrading MySQL Workbench from 6.3 to 8.0 the LOAD DATA LOCAL INFILE stopped working, returning Error Code: 1148. The used command is not allowed with this MySQL version.

Absolutely nothing was changed on configuration file, so I had to downgrade to 6.3 to continue working.

This behavior is clearly from Workbench 8.0, as in 6.3 the command works normally.

Even setting the global variable to ON the command don't work
SET GLOBAL local_infile = 'ON';

There is no available workaround on client side.

How to repeat:
Try a command such below:

drop table if exists tmpTable;
create temporary table tmpTable(id bigint, value nvarchar(150));
load data local infile 'E:\\DB\\values.csv' into table tmpTable
  fields terminated by ';' enclosed by '"' lines terminated by '\r\n';

Suggested fix:
Do not restrict by default the use of LOAD DATA LOCAL INFILE because it is very used by developers.
If you really want to restrict this from client side, you should create an option on Workbench 8.0 configuration to enable or not the execution of this commmand, furthermore you should put a big disclaimer about this on download page and/or on installation wizard.
[3 Aug 2018 12:01] Chiranjeevi Battula
Hello Rodrigo Viegas Viegas,

Thank you for the bug report.
This is most likely duplicate of Bug #72220, please see Bug #72220

Thanks,
Chiranjeevi.
[20 Feb 2019 10:05] Jose Bagatelli
Yet. Despite all the reports, this hasn't been fixed. Just upgrade from 6.3 to 8.0. It was working just fine 30 minutes ago, now I'm running the latest upgrade and this feature no longer works.
I'm running MySQL Workbench on Mac Mojave.
When this is going to be fixed?

Thanks

Jose Bagatelli
[5 Mar 2019 20:16] Kathy Keating
We, too, are blocked by this bug on Workbench 8.0.  Can we get a an update on a fix? There's no client side workaround that I've been able to find.
[6 Mar 2019 13:14] Peter Kniaz
We have run into the same problem.  This bug has prevented us from upgrading to version 8.  Load Data local infile is a function we need to have.
[8 May 2019 18:12] Tom Kaminski
As a workaround, first make sure you add to your C:\Program Files\MySQL\MySQL Server 8.0\my.ini file:

[client]
loose-local-infile = 1

Then use the command line version of mysql to run the "LOAD DATA LOCAL INFILE" query.  I couldn't find any way to enable this in MySQL Workbench 8 in the preferences or connection advanced settings.  It might be there, but undocumented?
[12 Nov 2020 12:28] Martin Baxter
This restriction can be removed from MySQL Workbench 8.0 in the following way.
Edit the connection, on the Connection tab, go to the 'Advanced' sub-tab, and in the 'Others:' box add the line 'OPT_LOCAL_INFILE=1'.

This should allow a client using the Workbench to run LOAD DATA INFILE as usual.
[3 May 2021 11:07] michael Baur
Hello Martin Baxter,

Hence your comment is the most recent one I've found after a diligent search addressing this topic I tried your suggestion. But unfortunately with no success. 

I added the line with the very same syntax and tried several reconnects/restarts but still I keep on receiving the error.

Do you have any further ideas as to what the cause could be? 

(I'm using version 8.0.21 built 16448441.)

I'd be very grateful.

Many thanks in advance.
Michael
[3 May 2021 11:40] michael Baur
Update:
currently it throws 
13:36:41 Error Code: 2068. LOAD DATA LOCAL INFILE file request rejected due to restrictions on access.	0,000 sec

Thanks
Michael
[28 Dec 2022 22:56] Jeffrey Carter
I was getting the same error, but Martin Baxter's suggestion above worked perfectly for me.

I am using Workbench 8.0.30 build 2054668 CE (64 bits)

Not sure if it may help, but I did close the connection, then followed Martin Baxter's instructions, then started a new connection. Worked like a charm!
[18 Apr 5:22] Himavanth Ila
I'm blocked by this bug on Workbench 8.0.  Can we get a an update on a fix? There's no client side workaround that I've been able to find. Can anyone help me with this ?
[25 Apr 20:58] Sean Seamonds
I'm on 8.0.36 and I can enter "OPT_LOCAL_INFILE=1" in the "Others:" box in the 'Advanced' tab of the 'Manage Server Connections' dialog, but I can't seem save it.  Thus it doesn't stick and doesn't work for me.

I can avoid this error in the command line client by starting my client with this command :
mysql -u <my_user_name> -p --local_infile=1

Suggestions around putting this in the config like so:
[mysql]
local-infile
local_infile=1

[client]
local-infile
local_infile=1

Incidentally I can also avoid this error in python and get the LOAD to work with the "allow_local_infile=True" arg when creating a mysql.connector.connection.