2

I am running the following statement to import data:

LOAD DATA LOCAL INFILE     'C:\\Users\\talkohavy\\Desktop\\MySQL_data\\categories.csv'
INTO TABLE BI_EX_OLTP.categories 
FIELDS TERMINATED BY ','
IGNORE 1 LINES;

And then I get this error:

error code 1148. the used command is not allowed with this mysql version.

How can I enable loading local data using the MySql Workbench and not the cmd?

Shadow
  • 33,525
  • 10
  • 51
  • 64
Tal Kohavy
  • 438
  • 2
  • 8
  • 22
  • There's [two answers here apart from `--local-infile`](https://stackoverflow.com/q/18437689/243245): my.cnf or SET GLOBAL. Do either of those work for you? – Rup Aug 26 '18 at 23:32
  • I ran the line: SET GLOBAL local_infile = 1; Its status became on. but still when i tried the "LOAD DATA LOCAL INFILE..." i got the same error. – Tal Kohavy Aug 27 '18 at 05:00

2 Answers2

9

This solution works for version 8.0.18:

In the advanced tab of the connection, put OPT_LOCAL_INFILE=1 in the others box.

setting_MySQL_workbench

Huanfa Chen
  • 577
  • 6
  • 15
5

I believe this is an issue with the new versions of Workbench (having the same issue in Workbench 8.0.12). I did not have this issue in the 5.7.x version of Workbench, and downgrading to this version has fixed the issue for me.

This bug is documented here: https://bugs.mysql.com/bug.php?id=91891

I recommend either downgrading to an older version of Workbench, or using a different means to execute the command (such as through the mysql CLI command, or using another tool to connect such as DataGrip, etc).