MySql reports 1205:1205 - Lock wait timeout exceeded; try restarting transaction, how to solve 1205

Problem: When executing a DDL statement in mysql, it reports 1205.

Originally wanted to delete data for a period of time, the statement is as follows:

delete from pdsw.mt_monitor_result_all where create_date<'2022-10-22 00:00:00';

The error is as follows: 1205 - Lock wait timeout exceeded; try restarting transaction, mainly because the source data is fart insert, it may not be submitted, and the resource is occupied. Now it is OK to kill the locked process id.

The main solution:

1. Execute SHOW FULL PROCESSLIST, find this statement, there is the id of this statement at the top, directly kill ID, it can be solved.

KILL ID

2. Execute select * from information_schema.innodb_trx to find out the statement id, as before, just kill it and it will be ok.

select * from information_schema.innodb_trx;

Guess you like

Origin blog.csdn.net/qq_52466976/article/details/127808605