Sorry, there is a mistake in the question. An explanation has been made in the answer
the scenario is that there is a script task, that starts multiple processes
these processes operate on multiple tables at the same time (only insert, for these tables, but may insert multiple times for a table), start a transaction from the first table, and commit the transaction after the last table, such as
. table1
table2
table3
table4
the order in which these tables can be manipulated is fixed, only from top to bottom, but the number of operations is uncertain (for example, process 1 operations 1, 4, process 2 operations 2, 4)
the storage engine used is innodb
mysql error message is
Deadlock found when trying to get lock; try restarting transactionin
error number 1213