MySQL错误#2014-命令不同步;您现在不能运行此命令 [英] MySQL error #2014 - Commands out of sync; you can't run this command now
问题描述
我正在使用MySQL,并且正在定义这样的存储过程:
I am using MySQL and I am defining a stored procedure like this:
delimiter ;;
Create procedure sp_test()
select * from name_table;
end
当我尝试执行该过程时,出现此错误:
When I try to execute that procedure I get this error:
#2014 - Commands out of sync; you can't run this command now
这是什么意思,我在做什么错?
What does this mean and what am I doing wrong?
推荐答案
来自
C.5.2.14.命令不同步 C.5.2.14. Commands out of sync 例如,如果您使用 This can happen, for example, if you are using 此帖子(摘自此处) 我已经解决了这个问题.我使用MySQL-Fron代替MySQL查询
浏览器.而且一切正常. I've solved that problem. I use MySQL-Fron instead MySQL Query
browser. And everything works fine. 让我认为这不是服务器或数据库问题,而是您正在使用的工具中的问题. makes me think that it's not a server or database problem but a problem in the tool you're using. 这篇关于MySQL错误#2014-命令不同步;您现在不能运行此命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
如果您在客户端代码中得到Commands out of sync; you
can't run this command now
,则您正在呼叫客户端
功能顺序错误.
If you get Commands out of sync; you
can't run this command now
in your client code, you are calling client
functions in the wrong order.mysql_use_result()
和
在调用mysql_free_result()
之前,尝试执行一个新查询.
如果您尝试执行两个返回数据的查询,也会发生这种情况
而不在两者之间调用mysql_use_result()
或mysql_store_result()
.mysql_use_result()
and
try to execute a new query before you have called mysql_free_result()
.
It can also happen if you try to execute two queries that return data
without calling mysql_use_result()
or mysql_store_result()
in between.