How to solve Error 1148 from MySql workbench and not cmd?

可紊 提交于 2020-02-02 11:37:47

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!