How to debug Lock wait timeout exceeded on MySQL?

前端 未结 11 1064
我寻月下人不归
我寻月下人不归 2020-11-22 11:46

In my production error logs I occasionally see:

SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction

11条回答
  •  时光说笑
    2020-11-22 12:22

    Take a look at the man page of the pt-deadlock-logger utility:

    brew install percona-toolkit
    pt-deadlock-logger --ask-pass server_name
    

    It extracts information from the engine innodb status mentioned above and also it can be used to create a daemon which runs every 30 seconds.

提交回复
热议问题