sql执行报错 但在Navicat可以执行
<select id="putAppAnalysisTaskOutfile" >
load data local infile #{putFilePath}
into table app_analysis_task
fields terminated by '|' lines terminated by '\n'
(<include refid="appAnalysisTaskUsedColumns"/>)
</select>mybatis执行报错,但sql在Navicat可以执行org.springframework.jdbc.BadSqlGrammarException:Error querying database. Cause: java.sql.SQLSyntaxErrorException: The used command is not allowed with this MySQL version
The error may exist in file
The error may involve defaultParameterMap
The error occurred while setting parameters
SQL: load data local infile ? into table app_analysis_task fields terminated by '|' lines terminated by '\n' ( name,market,app_num_threshold,create_time,end_time,process_percent,status,type_num,total_app_num,app_ratio,download_order )
Cause: java.sql.SQLSyntaxErrorException: The used command is not allowed with this MySQL version
; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: The used command is not allowed with this MySQL version
SHOW VARIABLES LIKE '%local%';
local_infile ON
参考下这个链接https://ask.csdn.net/questions/1061849 区别在于你在navicat中插入的是一条,那最外面的select * from去掉改成下面这样试试。另外insert into 表 select 语句不管在oracle还是mysql都是可以省略values关键字的 换个工具试试看 那就在 Navicat 中用 语法有差别把
页:
[1]