Mysql的避坑---- Mysql 数据库连接添加  allowMultiQueries=true属性

最近做项目时,发现操作数据库时 sql报错,如下:

### Error updating database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete from sys_user_role where user_id in 
         (  
            6
         )' at line 6
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: delete from sys_user where user_id in     (      ?    )    ;   delete from sys_user_role where user_id in     (      ?    )
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete from sys_user_role where user_id in 
         (  
            6
         )' at line 6
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'delete from sys_user_role where user_id in 
         (  
            6
         )' at line 6

mybatis的mapper的xml中 使用一个业务 操作两条sql的情况,出现以上的错误,将sql 语句拿到 navicat 执行,都可以执行,纳闷了很久。

主要原因:需要在创建数据库链接时,将允许 多条sql执行设置为 true,即可,如下图:

Mysql的避坑---- The error may involve defaultParameterMap #The error occurred while setting parameters相关推荐

  1. mybatis:### The error may involve defaultParameterMap### The error occurred while setting parameter

    完整报错: Caused by: org.apache.ibatis.exceptions.PersistenceException:  ### Error updating database.  C ...

  2. 查询时报错The error may involve defaultParameterMap ### The error occurred while setting parameters

    查询时报错The error may involve defaultParameterMap ### The error occurred while setting parameters 分页查询报 ...

  3. ### The error may involve defaultParameterMap ### The error occurred while setting parameters

    今天遇到一个错误,运行RankDao.selectById(id)直接给我报错,很不理解 错误信息: 2021-09-22 10:40:58.824 ERROR 8364 --- [nio-8888- ...

  4. SSM中mybtis报错### The error may involve defaultParameterMap ### The error occurred while setting param

    首先是前端弹出错误框如下: 查看后台报错信息如下 ### Cause: java.sql.SQLException: Error ; uncategorized SQLException; SQL s ...

  5. mybatis报错### The error may involve defaultParameterMap ### The error occurred while setting paramete

    前两天写的一个springboot+mybatis的小项目在一个修改数据库数据的功能出现了 ###The error may involve defaultParameterMap ###The er ...

  6. The error may involve defaultParameterMap ### The error occurred while setting paramete

    eclipse报错### The error may involve defaultParameterMap ### The error occurred while setting paramete ...

  7. Mybatis The error may involve defaultParameterMap ### The error occurred while setting parameters

    因为参数为空导致"<"foreach collection="ids" item="id" separator=",&quo ...

  8. mybatis使用foreach进行批量操作 The error may involve defaultParameterMap

    触发现象 xml: <insert id="insertByList"><foreach collection="tagList" item= ...

  9. The error may exist in bshr/mapper/PfmMapper.xml ### The error may involve defaultParameterMap

    问题背景: springboot + mybatis + vue项目,IDEA开发. 绩效计划通过eid(员工编号)关联一个员工,有一个绩效计划表还有一个员工表. 关联方式为:嵌套查询.可以有两种实现 ...

最新文章

  1. 艾伟:控件之ViewState
  2. SpringBoot+Shiro学习(八):RememberMe
  3. wxWidgets:wxStdInputStream类用法
  4. 计算机科学英文杂志,Journal of Computer Science Technology
  5. mysql函数封装_PHP访问MYSQL数据库封装类(附函数说明)
  6. NSURLProtocol概述
  7. 热式气体质量流量计检定规程_宁夏热式气体质量流量计价位,玻璃管液位计怎么样...
  8. Shell离线脚本安装mysql、更新密码
  9. MySQL高级之事务
  10. java读取html文件内容的代码_【代码审计】xyhcms3.5后台任意文件读取
  11. My first project
  12. 20164317《网络对抗技术》Exp3 免杀原理与实践
  13. sourceTree 的使用
  14. OpenGL 概念整理
  15. 瀑布模型、V模型、原型模型、增量模型、螺旋模型、喷泉模型
  16. ImageMagick (Magick++ for C++) configuration in Visual Studio 2012
  17. lldb调试mysql 插件命令
  18. 工作流Airflow的性能优化,应对dag数目的激增
  19. Activiti流创建数据表的过程中报错 java.sql.SQLSyntaxErrorException: Table ‘activiti.act_ge_property‘ doesn‘t exis
  20. 钰泰ETA2821,42V/1.5A降压转换器,集成OVP功能防浪涌

热门文章

  1. Python 乘法口诀
  2. MySQL的数据类型(一)
  3. 程序员如何站着每年赚 30w 美金
  4. 【干货】 xgboost如何自定义eval_metric ( feval ) ?
  5. 28181协议、设备配置装维、测试(海康网络摄像机)
  6. 黑洞大作战游戏架构设计与实现
  7. Android基础入门教程——4.3.1 BroadcastReceiver牛刀小试
  8. Neat Download Manager(ndm下载器)
  9. 软件测试工作面试的74个常见问题
  10. GB2312-80 所有汉字排序,拼音