SpringBoot+Mybatis+Druid批量更新multi-statement not allow异常
2018-01-11 19:41
1036 查看
Mybatis集成Druid批量更新时,出现异常
Error updating database. Cause: java.sql.SQLException: sql injection violation, multi-statement not allow :
![](https://img-blog.csdn.net/20180111194124910?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvY2hlbnpoYW9zdGFyaw==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
经查询,Druid的multiStatementAllow默认是false,需要开启,设置成true。
注:filters和proxyFilters两个不要同时配置。
1.开始这样配置的, multiStatementAllow属性设置成true一直不生效。
(1)yml文件中
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
filters: stat,wall
(2)设置数据源
![](https://img-blog.csdn.net/20180111195840140?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvY2hlbnpoYW9zdGFyaw==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)
2.修改yml文件,删除filters中的wall拦截器生效。
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
filters: stat
此种配置亲测有效。这样方式可能不是最好的配置,欢迎评论指正。
Error updating database. Cause: java.sql.SQLException: sql injection violation, multi-statement not allow :
经查询,Druid的multiStatementAllow默认是false,需要开启,设置成true。
注:filters和proxyFilters两个不要同时配置。
1.开始这样配置的, multiStatementAllow属性设置成true一直不生效。
(1)yml文件中
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
filters: stat,wall
(2)设置数据源
2.修改yml文件,删除filters中的wall拦截器生效。
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
filters: stat
此种配置亲测有效。这样方式可能不是最好的配置,欢迎评论指正。
相关文章推荐
- springboot druid 数据库批量更新错误 multi-statement not allow
- Druid执行多条SQL异常:Cause: java.sql.SQLException: sql injection violation, multi-statement not allow
- 千遍一律的multi-statement not allow解决方案对我没用
- MySql+Mybatis+Druid之SqlException:sql injection violation, multi-statement not allow
- MySql+Mybatis+Druid:sql injection violation, multi-statement not allow
- MySql+Mybatis+Druid:sql injection violation, multi-statement not allow
- druid报异常 “sql injection violation, part alway true condition not allow”的解决方案
- Mysql批量更新的一个坑-&allowMultiQueries=true允许批量更新
- 在myeclipse工具中执行maven build异常 -Dmaven.multiModuleProjectDirectory system property is not set. Check $
- mybatis批量更新 allowMultiQueries
- 【JAVA秒会技术之异常解决】Dmaven.multiModuleProjectDirectory system propery is not set
- 理解 SET CHAINED command not allowed within multi-statement transaction.
- SyntaxError:Strict mode does not allow function declaration in a lexically nested statement.
- Mysql 批量更新操作的时候出错 “Multi-statement transaction required more than 'max_binlog_cache_size' bytes of s
- 三大框架整合异常之No Hibernate Session bound to thread, and configuration does not allow creation of non-tran
- 在myeclipse执行maven build 异常 -Dmaven.multiModuleProjectDirectory system property is not set.
- SyntaxError:Strict mode does not allow function declaration in a lexically nested statement.
- 更新证书,打包异常"UUID not found"
- SyntaxError:Strict mode does not allow function declaration in a lexically nested statement.
- Maven Web工程运行异常:Maven.multiModuleProjectDirectory system propery is not set的问题