Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell if a MySQL process is stuck?

I have a long-running process in MySQL. It has been running for a week. There is one other connection, to a replication master, but I have halted slave processing so there's effectively nothing else going on.

How can I tell if this process is still working? I knew it would take a long time which is why I put it on its own database instance, but this is longer than I anticipated. Obviously, if it is still doing work, I don't want to kill it. If it is zombied, then I don't know how to get the work done that it's supposed to be doing.

It's in the "Sending data" state. The table is an InnoDB one but without any FK references that are used by the query. The InnoDB status shows no errors or locks since the query started.

Any thoughts are appreciated.

like image 576
user87843 Avatar asked Apr 06 '09 22:04

user87843


1 Answers

Try "SHOW PROCESSLIST" to see what's active.

Of course if you kill it, it may then want to take just as much time rolling it back.

like image 51
dkretz Avatar answered Sep 21 '22 15:09

dkretz