[英]How do I simulate a deadlock in MySql without programming scripts?
It's sometimes useful to be able to simulate a deadlock in a database (such as MySQL) for testing purposes. 能够模拟数据库(例如MySQL)中的死锁以进行测试有时很有用。 If you have write access to the database, you can simulate the deadlock by starting a write transaction on a table another query will attempt to use.
如果您具有对数据库的写访问权,则可以通过在另一个查询将尝试使用的表上启动写事务来模拟死锁。
begin;
begin;
update <table> set <column>=<value>;
update <table> set <column>=<value>;
rollback;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.