A query has locked a table in MySQL.
How can the running query’s session be killed to unlock the table?
I do not know to view the active sessions/processes in MySQL. How can I this via SSH?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Go into PuTTY, and then log into MySQL. Run the following in MySQL:
That will show a list of all running processes. You will probably be able to find the query that is locking your tables as it will likely be the longest running query with a bunch of other queries waiting for the lock release. Make a note of the process id of this query.
Then run:
That will kill the process. Of course you need to do this as the user that has privilege to stop the query that was started (so use the same user or
rootif you have to).