zoukankan      html  css  js  c++  java
  • Mysql报Deadlock found when trying to get lock; try restarting transaction问题解决

    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

  • 相关阅读:
    相关分析[SDOI2017]
    排序[HEOI2016/TJOI2016]
    逆序对[AHOI2008]
    逆序对数列[HAOI2009]
    小Z的袜子「2009国家集训队」
    http抓包—Content-Type讲解
    mysql——leetcode问题记录
    linux--vi命令
    Linux—echo命令
    Linux—文件命令之touch命令
  • 原文地址:https://www.cnblogs.com/lqmblog/p/15506550.html
Copyright © 2011-2022 走看看