Mysql - #1205 - Lock wait timeout - update of a database's table from another database's table

23 Views Asked by At

I have two structurally identical databases but with different data and I am trying to update one based on a shared column (a hash used as reference).

I get the "#1205 - Lock wait timeout" error while trying the following command:

UPDATE DB1.table1 M1 INNER JOIN DB2.table2 M2 on M1.md5 = M2.md5 SET M1.field1 = M2.field1, M1.field2 = M2.field2

Short explanation:

  • In the code below M1 is the table which I'm trying to update. Around 130k lines total
  • M2 is the source table from another database, 33k lines

Both tables are not accessed by any process / application and the query is ran alone with no other concurrent process which could lock the tables in anyway.

Any idea how to fix this?

Thank you for the help!

Thomas

0

There are 0 best solutions below