在MySql 中执行了一个比较耗时的存储过程,发现一直没有执行完成,如何终止呢?
下面是解决步骤:
一,运行show processlist命令,找到存储过程所在的线程ID;show processlist
query end说明有未完成的事务(This state occurs after processing a query but before the freeing items state.)。
二,运行命令:kill 线程ID假设需要删除上面线程ID=13,使用如下命令:
kill 13;
然后再次运行 show processlist 命令,发现线程ID=13 已经不存在了。
,