MySQL 被杀死的进程仍在我的进程列表中
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10883936/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Process that was killed still on my processlist
提问by cool_cs
The thread that I killed is still on my thread list How do I eliminate it?
我杀死的线程仍在我的线程列表中 我如何消除它?
+-----+------+-----------+-------------+---------+-------+-----------+------------------------------------------------------------------------------------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-----+------+-----------+-------------+---------+-------+-----------+------------------------------------------------------------------------------------------------------+
| 678 | root | localhost | hthtthv | Killed | 36923 | query end | INSERT INTO `gtgttg` VALUES (1,'tgtg'),(2,'Shopping'),(4,'tgtgtg'),( |
| 695 | root | localhost | NULL | Query | 0 | NULL | show processlist |
+-----+------+-----------+-------------+---------+-------+-----------+------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
回答by Nanne
It needs to revert the actions it did, so this can take a long time. If it is an INNODB database, you can for instance look at this question: https://dba.stackexchange.com/questions/5654/internal-reason-for-killing-process-taking-up-long-time-in-mysql
它需要恢复它所做的操作,因此这可能需要很长时间。如果它是一个 INNODB 数据库,您可以例如查看这个问题:https: //dba.stackexchange.com/questions/5654/internal-reason-for-killing-process-taking-up-long-time-in- mysql
So in the end: you need to wait for it to be eliminated
所以最后:你需要等待它被淘汰
回答by Benedikt K?ppel
In my case, my /var partition was full, where the MySQL binlogs are written. Once I freed some disk space, the killed connections immediately went away.
就我而言,我的 /var 分区已满,其中写入了 MySQL 二进制日志。一旦我释放了一些磁盘空间,被杀死的连接就会立即消失。
回答by Ketan Patel
I know this is an old question. I faced a similar situation, where the thread was stuck in killed status.
我知道这是一个老问题。我遇到了类似的情况,线程卡在了已终止状态。
Instead of forcibly killing the mysqld, I issued
我没有强行杀死mysqld,而是发出
sudo service stop mysqld
The command could different depending on your OS, but you need to gracefully ask the system to terminate the daemon. It will kill the stuck thread and there will be no side effects on the database as it will be a normal shutdown.
该命令可能因您的操作系统而异,但您需要优雅地要求系统终止守护程序。它将杀死卡住的线程,并且不会对数据库产生副作用,因为它将正常关闭。
Other suggestion above asked to kill the process, which will lead to database recovery which could have its own issues. So I would recommend going with the daemon graceful stop.
上面的其他建议要求终止该进程,这将导致数据库恢复可能有其自身的问题。所以我建议使用守护进程优雅停止。
Hope that helps.
希望有帮助。