问题
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?
回答1:
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).
回答2:
This solution works for version 8.0.18:
In the advanced
tab of the connection, put OPT_LOCAL_INFILE=1
in the others
box.
来源:https://stackoverflow.com/questions/52030767/how-to-solve-error-1148-from-mysql-workbench-and-not-cmd