technoparkcorp
asked on
How to resolve a deadlock in MySQL?
When I start new transaction in MySQL sometimes I get an error:
(1205) Lock wait timeout exceeded; try restarting transaction
How can I resolve this deadlock in such case? In other words, I want to KILL the transaction which created this deadlock. Can I do this?
(1205) Lock wait timeout exceeded; try restarting transaction
How can I resolve this deadlock in such case? In other words, I want to KILL the transaction which created this deadlock. Can I do this?
ASKER
I want to kill a transaction right from my PHP script. Not manually from console
ASKER
in other words, how can I kill ALL transactions in MySQL?
the simplest would be the restart MySQL.
otherwise, to see all sessions:
http://dev.mysql.com/doc/refman/5.0/en/show-processlist.html
to kill a session:
http://dev.mysql.com/doc/refman/5.0/en/kill.html
otherwise, to see all sessions:
http://dev.mysql.com/doc/refman/5.0/en/show-processlist.html
to kill a session:
http://dev.mysql.com/doc/refman/5.0/en/kill.html
ASKER
any chance to kill a transaction?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
now, to find the session, I found nothing but some forum entry saying:
<...>
Run mysqladmin debug
Then, the list of locks will be listed in the error log file.
<...>
hope this helps