Answer the question
In order to leave comments, you need to log in
How to fix deadlock in mysql?
Hello! The following error is thrown into the log.
Deadlock found when trying to get lock; try restarting transaction
UPDATE `tb_ads_dlink_visits` SET `status` =1, `money`=0.02771, `date`=1592807736 WHERE `idu` = 131986 and `ids` = 12735 and `status` = 0
DELETE FROM `tb_ads_dlink_visits` WHERE `status`='0' AND `date` < UNIX_TIMESTAMP() - 300
Answer the question
In order to leave comments, you need to log in
15.7.5 Deadlocks in InnoDB
remove delete from production. let unnecessary records accumulate better than rebuilding all indexes of the table will hang locks on parallel queries.
Just read the doc carefully under the link. practice shows that the easiest way to avoid locks is to correct the logic.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question