How to fix ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction

The commands to unlock stuck mysql tables.

List locked tables

show open tables where in_use > 0;

List current processes

show processlist;

Kill process

phpMyAdmin has a link to click to kill the process, otherwise replace [PROCESS_ID] in the command below:

kill [PROCESS_ID];