When I try to drop a table, MySQL hangs. I don’t have any other open sessions. How to resolve this? I have waited for 10 hours and the process has not terminated.
Share
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.
If this is your table, see this link
you have an implicit deadlock. Kill the other transactions to release the drop, or kill the drop to release the other transactions.
You can use KILL thread_id, in sql_plus.
I’m adding further information since I came up with another interesting experience.
MetadataDead locks may equally happen between a ddl operation on a given table (drop,alter…) and a select query on that table.Yes,
select.So, if you loop over a cursor in mysql (or php, for example with
pdo::fetch), and you run a ddl statement on the same table(s), you will get a deadlock.One solution to this atypical scenario is to release the implicit locks with a
commitstatement systematically after any select statement is completely fetched.