Force An Unlock Of Mysql Tables If Locked

Sometimes you have a locked table when something went wrong and you can not go on without it being unlocked.
here is how to do that.

1) Enter MySQL

mysql -u your_user -p

2) Let’s see the list of locked tables

show open tables where in_use>0;

3) Look at the current processes

show processlist;

4) Kill one of these processes with the lock.

kill put_process_id_here;

That’s it. Restart your process and it should go on working again