MySQL - Looking for Table Locks and Killing them if needs be

May 1st, 2008

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

Why adding an index to a DB table isn’t always a good idea

April 29th, 2008

MySQL - how to create a Stored Procedure

April 29th, 2008

A well recommended agency for Medical workers in New Zealand and Australia

March 29th, 2008

Upgrading PEAR - A moan and groan

March 12th, 2008

Making MySQL OR performance better

February 28th, 2008

Java: (IMHO) Why independent application builders are shying away from it

February 23rd, 2008

PHP needs tuples!

October 20th, 2007

Buzzword Paybacks

October 2nd, 2007

Grrr argghhhh! PHP consistency

September 16th, 2007