ERROR 1148: The used command is not allowed with this MySQL version

后端 未结 12 1279
感动是毒
感动是毒 2020-11-27 03:46

I am trying to load data into mysql database using

LOAD DATA LOCAL
INFILE A.txt
INTO DB
LINES TERMINATED BY \'|\';

the topic of this questi

12条回答
  •  执笔经年
    2020-11-27 04:46

    If you are using Java8 or + version, JDBC and MySql8 and facing this issue then try this:

    Add parameter to connection string:

    jdbc:mysql://localhost:3306/tempDB?allowLoadLocalInfile=true
    

    Also, set

    local_infile = 1

    in my.cnf file.

    The latest version of mysql-java-connector might be wont allow directly to connect to local file. So with this parameter, you can able to enable it. This works for me.

提交回复
热议问题