mysql: Commands out of sync; you can't run this command now
2016-12-16 16:54
821 查看
1.官方说明
http://dev.mysql.com/doc/refman/5.7/en/commands-out-of-sync.html
2.遇到此问题的现象:
在使用mysql_query执行多条语句时,发现虽然此函数成功执行了,但数据库中并没发现执行后的新数据,以及多次以后,会发现执行多条语句会出错。
原因:是由于mysql_res*的没释放.
strSQL中是含有N条sql语句的字符串,在执行mysql_query后,会对应的出现N个MYSQL_RES *,通过上述代码将所有的结果集释放掉即可。
http://dev.mysql.com/doc/refman/5.7/en/commands-out-of-sync.html
2.遇到此问题的现象:
在使用mysql_query执行多条语句时,发现虽然此函数成功执行了,但数据库中并没发现执行后的新数据,以及多次以后,会发现执行多条语句会出错。
原因:是由于mysql_res*的没释放.
MYSQL_RES * pRes; int nError = mysql_query(m_pConn, strSQL); do { pRes = mysql_use_result(m_pConn); mysql_free_result(pRes); } while (!mysql_next_result(m_pConn));
strSQL中是含有N条sql语句的字符串,在执行mysql_query后,会对应的出现N个MYSQL_RES *,通过上述代码将所有的结果集释放掉即可。
相关文章推荐
- python mysql 2014 Commands out of sync; you can't run this command now
- PHP执行MYSQL存储过程报错:Commands out of sync; you can't run this command now 问题的解决
- PHP+MySQL连续插入数据报错:Commands out of sync; you can't run this command now & 读取Excel数据并批量插入到数据中
- MySQL一次执行多条语句的实现及常见问题(C API Commands out of sync; you can't run this command now)
- PHP执行MYSQL存储过程报错:Commands out of sync; you can't run this command now
- PHP执行MYSQL存储过程报错:Commands out of sync; you can't run this command now
- mysql 出现 Commands out of sync; you can't run this command now
- php用mysql_query()调用存储过程后无法再执行sql报错:commands out of sync you can't run this command now
- C++ Mysql调用 错误:2014 :Commands out of sync; you can't run this command now
- MySQL一次执行多条语句的实现及常见问题(C API Commands out of sync; you can't run this command now)
- Mysql::Error: Commands out of sync; you can't run this command now: SHOW TABLES解决方案
- ERROR (ProgrammingError) (2014, "Commands out of sync; you can't run this command now")
- python Commands out of sync; you can't run this command now
- LR错误: Commands out of sync; you can't run this command now 解决方法
- 解决error:2014 Commands out of sync; you can't run this command now
- 解决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
- Commands out of sync; you can't run this command now
- Commands out of sync; you can't run this command now
- Commands out of sync; you can't run this command now