如何获取我的`MySQL`查询获取的锁数?

时间:2015-05-15 14:08:55

标签: mysql sql-update locking

如何获取MySQL更新查询获取的锁定数量?

示例查询update employees set store_id = 0 where store_id = 1;

1 个答案:

答案 0 :(得分:0)

最后,我能够通过以下一组MySQL语句获得获取的锁数。

begin;
update employees set store_id = 0 where store_id = 1;
show engine innodb status\G
commit;

编辑:

我们还可以使用以下查询获取当前事务的锁定详细信息。

select * from information_schema.innodb_locks;