使用connect函数连接数据库时使用设置选项CLIENT_MULTI_STATEMENTS后,可以一次执行多条通过;分割的sql语句。

需要要注意的是:
即使执行的是不会返回结果集的两条update语句,依旧需要对结果集进行处理。否则,在之后的sql语句执行时报错:
MySQL error(2014) Commands out of sync; you can't run this command now

如何处理,请参考:
MySQL error(2014) Commands out of sync; you can’t run this command now(情形1)

参考资料:
MySQL 一次执行多条语句的实现及常见问题
mysql error:2014 Commands out of sync; you can’t run this command now

MySQL error(2014) Commands out of sync; you can't run this command now(情形2)相关推荐

  1. mysql error:2014 Commands out of sync; you can't run this command now

    最近在项目中经常会出现数据库操作失败的,日志抛出的错误的 Commands out of sync; you can't run this command now.但是把具体的这条sql语句放到可视化 ...

  2. commands out of sync mysql_MySQL问题一则:Commands out of sync; you can't run this command now以及相关问题...

    录制程序有一功能:将录制的文件信息写入MySQL数据库,供BS系统查询. 因此封装了一个MySQL类,进行数据库操作. 主要接口为Update():执行SQL语句. 现在问题来了: (一)在某个场景下 ...

  3. mysql执行存储过程提示out of_PHP执行MYSQL存储过程报错:Commands out of sync; you can't run...

    php中在同时执行2个存储过程时,有一个程序2个储存过程都执行,有一个程序只执行第一个调用.2个都执行的调用如下: $mydb->query("delete from pinfo wh ...

  4. commands out of sync mysql,MySQL-python: Commands out of sync

    在给 MySQL 数据库访问层增加新功能时遇到了这样的错误: ProgrammingError: (2014, "Commands out of sync; you can't run th ...

  5. Mysql++关于多数据集查询Commands out of sync; you can‘t run this command now的问题

    今天在项目中使用了Mysql++调用Mysql的存储过程来实现功能,但是碰到一个有意思的问题,当成功调用存储过程后,再次做其他的查询,确返回Commands out of sync; you can' ...

  6. commands out of sync错误

    第一种情况: commands out of sync.  Did you run multiple statements at once 可能的原因:是在事务之中写了查询语句. 解决方案:把查询语句 ...

  7. 「golang」panic: commands out of sync. Did you run multiple statements at once

    [问题现象] go使用go-sql-driver连接mariaDB,如下,提示: panic: commands out of sync. Did you run multiple statement ...

  8. db mysql error list / mysql tools / mysql error_list

    db mysql http://lindows.iteye.com/admin/blogs/232318 http://dev.mysql.com/doc/refman/5.1/zh/error-ha ...

  9. Linux下mysql ERROR 1045,Mysql无法执行批处理

    Linux下mysql ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO) 每次启用mysql都出现这个 ...

  10. mysql error.log 权限_docker-compose 启动mysql 容器时 error.log 无权限访问怎么办?

    场景分析 docker-compose 运行mysql 容器的时候一直报下面的错误: .../var/log/mysql/mysql-error.log' for error logging: Per ...

最新文章

  1. 直观获取redis cluster 主从关系
  2. BLE-NRF51822教程5-静态密码设置
  3. C语言atoi()函数:将字符串转换成int(整数)和sprintf和memset
  4. 通俗理解决策树算法中信息增益的
  5. java面试题三_最全的java面试题目三
  6. Ranger开源流水线docker化实践案例
  7. mysql semi sync_MySQL Semisync
  8. css修改layui的下拉框样式 js_layui的安装以及简单操作
  9. 洛谷——P2637 第一次,第二次,成交
  10. python封装sql脚本_pymysql的简单封装代码实例
  11. [bzoj 1030][JSOI2007]文本生成器
  12. 三级计算机等级2021年9月考试准考证下载步骤
  13. 实现手风琴抽屉式网页特效
  14. Python3.4中文手册chm,3.7中文手册HTML
  15. ICDAR 2019 CROHME + TFD比赛 手写数学表达识别与排版公式检测的竞争
  16. vb.net学习日记3.29
  17. 一加6可以刷的rom_一加OnePlus 6刷机包_线刷包_救砖包_官方ROM包_固件包下载- 线刷宝ROM中心...
  18. 四大盈利互联网经营理念
  19. 同花顺编程入门(一)
  20. 让人变年轻的特效怎么做?教你制作变年轻特效小妙招

热门文章

  1. [译]C语言实现一个简易的Hash table(5)
  2. 深度学习课程笔记(十三)深度强化学习 --- 策略梯度方法(Policy Gradient Methods)...
  3. linux文件系统简析
  4. IIS HTTP文件服务器搭建步骤
  5. Silverlight像素着色器编写简明指南 附送文字描边效果
  6. linux图标大全——这些你认识多少?
  7. JSP 内置对象request常见用法
  8. 4.微服务:从设计到部署 --- 服务发现
  9. 28.ldconfig
  10. 39. 日志记录与使用情况跟踪