51Testing软件测试论坛
标题: sql执行报错 但在Navicat可以执行 [打印本页]
作者: 测试积点老人 时间: 2021-8-27 13:33
标题: 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 [E:xxxx.xml]
- 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
复制代码
作者: bellas 时间: 2021-8-30 09:42
参考下这个链接https://ask.csdn.net/questions/1061849
作者: 海海豚 时间: 2021-8-30 10:00
区别在于你在navicat中插入的是一条,那最外面的select * from去掉改成下面这样试试。另外insert into 表 select 语句不管在oracle还是mysql都是可以省略values关键字的
作者: qqq911 时间: 2021-8-30 11:13
换个工具试试看
作者: litingting0214 时间: 2021-8-30 16:40
那就在 Navicat 中用
作者: jingzizx 时间: 2021-8-30 17:12
语法有差别把
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) |
Powered by Discuz! X3.2 |