MySQL - Looking for Table Locks and Killing them if needs be
Quick tip, for MySQL you’ll occasionally get problems where some processes lock a table (for MyISAM tables atleast) and you need to find out what the rogue query is (or just look at what’s being executed on your server at any time).
If so use the command “SHOW PROCESSLIST;” - this will show you the process id vs. the information for that process (what the query/update is and the current status).
Where you see a LOCK at the top and lots of lower entries that are locked on the same entity then you can always KILL that process using the command “KILL process-id;” (e.g. to kill process 1234 then you’d execute “KILL 1234;”)
Hope that helps people