C mysql (C API Commands out of sync; you can't run this command now)
错误出现在当一个用户使用查询,另一个用户再使用此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)的更多相关文章
- 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 ...
- 使用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 ...
- error:2014 Commands out of sync; you can't run this command now
如下错误: 分析原因: 前端ajax请求后台,共用同一个链接. 搜索别人的解决方案:http://blog.csdn.net/grass_ring/article/details/3499402 用m ...
- _mysql_exceptions.ProgrammingError:(2014, "commands out of sync; you can't run this command now")
今天,测试dashboard上的一些graph, 发现,当多个graph同时向后台请求数据(异步)的时候, 出现了上述错误.而且,三个bug交替出现,另外两个bug分别是:python stop re ...
- mysql_query error:Commands out of sync;you can't run this command now
MYSQL_REST *result没有释放, 用mysql_free_result(result)即可.
- centos下安装mysql(安装,启动,停止,服务端口查询,用户密码设定)
http://www.2cto.com/database/201305/208114.html http://smilemonkey.iteye.com/blog/673848 netstat -na ...
- MySql: ”Commands out of sync“Error (Connect/C++)
使用 Connector/C++ 查询 Mysql , 连续调用存储过程时 会出现如下: Commands out of sync; you can't run this command now,st ...
- 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 ...
- 亿级用户下的新浪微博平台架构 前端机(提供 API 接口服务),队列机(处理上行业务逻辑,主要是数据写入),存储(mc、mysql、mcq、redis 、HBase等)
https://mp.weixin.qq.com/s/f319mm6QsetwxntvSXpKxg 亿级用户下的新浪微博平台架构 炼数成金前沿推荐 2014-12-04 序言 新浪微博在2014年3月 ...
随机推荐
- postgresql远程连接中断的处理
在网络上连接远程服务器postgresql时,不活动时间稍长就会自动断开连接,不利于操作. 琢磨了一下,服务器上使用以下网络配置时,解决了这个问题. #man 7 tcp net.ipv4.t ...
- Sword pcre库使用
#include <stdlib.h> #include <string.h> #include "regularhelper.h" #include &q ...
- 【转】C#解析Json Newtonsoft.Json
Newtonsoft.Json源码 Newtonsoft.Json介绍 在做开发的时候,很多数据交换都是以json格式传输的.而使用Json的时候,我们很多时候会涉及到几个序列化对象的使用:DataC ...
- (笔记)Mysql命令drop database:删除数据库
drop命令用于删除数据库. drop命令格式:drop database <数据库名>; 例如,删除名为 xhkdb的数据库:mysql> drop database xhkdb; ...
- 性能优化系列四:Tomcat优化
一.Tomcat工作原理 1. TCP的三次握手四次挥手 三次握手: 说明: 类比于A和B打电话: A对B说:你好,我是A,你能听到我说话吗? B对A说:嗯,我能听到你说话 A对B说:好,那我们开始聊 ...
- (转)android媒体--stagefright概述【一】
转自:http://blog.csdn.net/loovejava/article/details/8971790 最近杂七杂八的忙碌着,前几天看了下这部分主要是stagefright模块的,所以更改 ...
- php -- php模拟浏览器访问网址
目前我所了解到的在php后台中,用php模拟浏览器访问网址的方法有两种: 第一种:模拟GET请求:file_get_contents($url) 通过php内置的 file_get_contents ...
- VMware Workstation与VM ware Esxi使用OVF文件交互
实验环境: VMware Workstation 12 Pro 版本 VMware Esxi 6.0.0 版本 VMware Workstation安装一个Linux系统,把VMware Wor ...
- XSD 数据类型
字符串数据类型(String Data Type) 字符串数据类型可包含字符.换行.回车以及制表符. 下面是一个关于某个 scheme 中字符串声明的例子: <xs:element name=& ...
- Jquery Gritter set position
You can try... //css .gritter-center{ position:fixed; left:33%; right:33%; top:33% } //Javascript $. ...