One of the table in mysql DB is getting locked.
Please let me know the steps that i should follow to find the root cause behind it i.e. who is locking the table and when ?
Thanks,
Sachin
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.
First, check that the table is locked – does it appear in the results of:
If it is currently locked, from the command line, run:
(
<user>is most likelyroot, depending on your set-up)Now check your error log (this is inside the data directory by default, find the location by checking your
my.cnffile). You should find details of the process doing the locking.The relevant bit of the output looks like:
From within the database (with a user with the
SUPERprivilege) runSHOW PROCESSLISTto find out which session the logs are referring to. In the example above, you want the process ID54(identified by the(54:12)).