0

Mysql - Table lock error

Question:

I am experiencing some problems with table locking. when I am trying to write/update to tables it's showing the error

Table 't1' was locked with a READ lock and can't be updated

Linux MySQL Add a comment
connor
asked Dec 01 2020

Answer

0

Answer:

Here's what I do to FORCE UNLOCK FOR some locked tables in MySQL

Enter MySQL

mysql -u your_user -p

Let's see the list of locked tables

mysql> show open tables where in_use>0;

Let's see the list of the current processes, one of them is locking your table(s)

mysql> show processlist;

Let's kill one of these processes

mysql> kill put_process_id_here;

Add a comment
linuxhelp
asked Dec 01 2020
edited Dec 01 2020
Post your Answer