Mysql报Deadlock found when trying to get lock; try restarting transaction问题解决!!

事务1 begin;                                                                     事务2begin;

select * from a where id = 1 for update;

                                                   select * from a where id = 2 for update;

select * from a where id = 2 for update; lock wait 锁等待

                                                                                               select * from a where id = 1 for update;    (  执行完就i报:Deadlock found when trying to get lock; try restarting transaction)

这个时候事务2 被干掉了,只剩下了事务1

 

select * from information_schema.INNODB_TRX
trx_mysql_thread_id

kill 进程ID


原文链接:https://blog.csdn.net/qq_44240587/article/details/108400666

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-23
  • 2022-12-23
  • 2021-05-17
  • 2021-10-12
  • 2021-12-10
猜你喜欢
  • 2021-12-28
  • 2021-06-11
  • 2021-06-30
  • 2021-08-11
  • 2022-02-24
  • 2021-10-02
  • 2022-12-23
相关资源
相似解决方案