php 批量更新死锁,php – 在尝试获取锁定时,哪个查询导致死锁;尝试重新启动事务...

我无法弄清楚哪个Query在尝试获取锁定时导致死锁;尝试重新启动事务.

我的

mysql包装器有以下几行

if (mysql_errno($this->conn) == 1213) {

$this->bug_log(0,"Deadlock. SQL:".$this->sql);

}

bug_log写入文件的位置.

错误日志文件没有死锁错误,但/var/log/mysqld.log有多个记录:

111016 3:00:02 [ERROR] /usr/libexec/mysqld: Deadlock found when trying to get lock; try restarting transaction

111016 3:00:02 [ERROR] /usr/libexec/mysqld: Sort aborted

111016 3:00:02 [ERROR] /usr/libexec/mysqld: Deadlock found when trying to get lock; try restarting transaction

111016 3:00:02 [ERROR] /usr/libexec/mysqld: Sort aborted

111016 3:00:02 [ERROR] /usr/libexec/mysqld: Deadlock found when trying to get lock; try restarting transaction

111016 3:00:02 [ERROR] /usr/libexec/mysqld: Sort aborted

我该如何追踪它?