错误出现在当一个用户使用查询,另一个用户再使用此sql连接进行查询的时候;

原因是因为上一次使用此sql连接进行查询时没有将所有的结果集给释放掉,在所有使用此sql连接进行查询的地方将所有的结果集给释放掉,正确的做法如下

    MYSQL_RES    *result_ptr = mysql_store_result(tpSqlConn);
if (result_ptr)
{
MYSQL_ROW row = mysql_fetch_row(result_ptr);
if (row)
{
rtn_str = row[];
} mysql_free_result(result_ptr); // 释放当前查询的所有结果集. 否则下次查询将会出错.
while (!mysql_next_result(tpSqlConn))
{
result_ptr = mysql_store_result(tpSqlConn);
mysql_free_result(result_ptr);
}
}

C mysql (C API Commands out of sync; you can't run this command now)的更多相关文章

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

    这个问题出现再 mysql和c  的api. 简单的解决方法是不使用api直接把整个连接和命令传过去. 例如,cmd = 'mysql -h 192.168.32.210 -P 3316 -u bfd ...

  2. 使用otl,报错:mysql Commands out of sync; you can't run this command now

    1.代码如下: void TestCache(otl_connect& otlConn) { try { ] = {}; sprintf(sql,"call test1(1)&quo ...

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

    如下错误: 分析原因: 前端ajax请求后台,共用同一个链接. 搜索别人的解决方案:http://blog.csdn.net/grass_ring/article/details/3499402 用m ...

  4. _mysql_exceptions.ProgrammingError:(2014, "commands out of sync; you can't run this command now")

    今天,测试dashboard上的一些graph, 发现,当多个graph同时向后台请求数据(异步)的时候, 出现了上述错误.而且,三个bug交替出现,另外两个bug分别是:python stop re ...

  5. mysql_query error:Commands out of sync;you can't run this command now

    MYSQL_REST *result没有释放, 用mysql_free_result(result)即可.

  6. centos下安装mysql(安装,启动,停止,服务端口查询,用户密码设定)

    http://www.2cto.com/database/201305/208114.html http://smilemonkey.iteye.com/blog/673848 netstat -na ...

  7. MySql: ”Commands out of sync“Error (Connect/C++)

    使用 Connector/C++ 查询 Mysql , 连续调用存储过程时 会出现如下: Commands out of sync; you can't run this command now,st ...

  8. CDH版本大数据集群下搭建Hue(hadoop-2.6.0-cdh5.5.4.gz + hue-3.9.0-cdh5.5.4.tar.gz)(博主推荐)

    不多说,直接上干货! 我的集群机器情况是 bigdatamaster(192.168.80.10).bigdataslave1(192.168.80.11)和bigdataslave2(192.168 ...

  9. 亿级用户下的新浪微博平台架构 前端机(提供 API 接口服务),队列机(处理上行业务逻辑,主要是数据写入),存储(mc、mysql、mcq、redis 、HBase等)

    https://mp.weixin.qq.com/s/f319mm6QsetwxntvSXpKxg 亿级用户下的新浪微博平台架构 炼数成金前沿推荐 2014-12-04 序言 新浪微博在2014年3月 ...

随机推荐

  1. PCL中分割_欧式分割(1)

    基于欧式距离的分割和基于区域生长的分割本质上都是用区分邻里关系远近来完成的.由于点云数据提供了更高维度的数据,故有很多信息可以提取获得.欧几里得算法使用邻居之间距离作为判定标准,而区域生长算法则利用了 ...

  2. Matlab基本用法

    转至:http://blog.sina.com.cn/s/blog_8354dda801012dyn.html 目录: 一.说明 二.数据类型及基本输入输出 三.流程控制 四.循环 五.数组.数组运算 ...

  3. 《编程之美》practice

    1.2.中国象棋将帅问题 要求:只用一个字节存储变量,输出将帅不照面的所有可能位置. 思路简单,就是穷举让将和帅不在同一列即可,用char高四字节和低四字节分别存储将和帅的位置,位置编号从1到9.代码 ...

  4. Java调用SQL Server存储过程

    1.调用普通存储过程(1)创建存储过程CREATE Procedure [dbo].[GetContactListByName]  /*根据联系人姓名获取联系人信息*/@Name nvarchar(5 ...

  5. Chart控件使用初步

    学习了Chart控件的初步使用方法,生成柱形图和饼图.    <asp:Chart ID="Chart1" runat="server" Width=&q ...

  6. Error:(1, 0) Plugin with id 'com.android.application' not found

    Error:(1, 0) Plugin with id 'com.Android.application' not found.Open File 这个错误是build.gradle造成的,我们打开文 ...

  7. 更改虚拟机UUID

    如何更改虚拟机UUID?以下方法适用于:Parallels Desktop 10 for MacParallels Desktop 9 for MacParallels Desktop 8 for M ...

  8. 使用sessionStorage解决vuex在页面刷新后数据被清除的问题

    https://www.jb51.net/article/138218.htm 1.原因 2.解决方法 localStorage没有时间期限,除非将它移除,sessionStorage即会话,当浏览器 ...

  9. Linux网络的设置

    一.介绍 目的:使Linux可以正常上网,前提是物理机可以上网 软件环境: 虚拟机版本: VMware Workstation 12, Linux系统版本:CentOS 7.3 二.设置网络 1,在登 ...

  10. ibatis中 $ 于 # 的 区别?

    转自: http://www.blogjava.net/lsbwahaha/archive/2009/04/16/266026.html 一个项目中在写ibatis中的sql语句时,where use ...