How to debug Lock wait timeout exceeded on MySQL?

前端 未结 11 827
我寻月下人不归
我寻月下人不归 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:33

    Activate MySQL general.log (disk intensive) and use mysql_analyse_general_log.pl to extract long running transactions, for example with :

    --min-duration=your innodb_lock_wait_timeout value

    Disable general.log after that.

提交回复
热议问题