MySql - Is there a queries queue somewhare

余生颓废 提交于 2019-12-22 08:31:23

问题


I used a loop in my php script to run insert queries into my db. The loop was looping thousand times. I stop my php script while it was till running. Nevertheless, my db table keeps on getting populated continously. I guess that there must be a queue. but this is only a guess. So I am wondering if I can stop all the pending queries from being executed? Also I am wondering if it is possible to see that queue somewhere? Thank you in advance for your replies. Cheers. Marc.


回答1:


There is no queue, unless you were using INSERT DELAYED.

You can kill the process that is inserting the data like this:

Run SHOW PROCESSLIST to find the id of the connecton you want to kill

Then run KILL CONNECTION <thread_id> to kill that connection.




回答2:


SHOW PROCESSLIST will give you a list of all currently running queries



来源:https://stackoverflow.com/questions/9721724/mysql-is-there-a-queries-queue-somewhare

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!