How to debug Lock wait timeout exceeded on MySQL?

前端 未结 11 952
我寻月下人不归
我寻月下人不归 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条回答
  •  旧时难觅i
    2020-11-22 12:14

    You can use:

    show full processlist
    

    which will list all the connections in MySQL and the current state of connection as well as the query being executed. There's also a shorter variant show processlist; which displays the truncated query as well as the connection stats.

提交回复
热议问题