Skip to content
sql

BEGIN;

SELECT * FROM base_acc_btc WHERE cid = 100470210 FOR UPDATE;

UPDATE base_acc_btc SET freemargin = freemargin + 2 WHERE cid = 100470210;

commit;

show global variables like "%timeout%";

set global innodb_lock_wait_timeout = 10;

查看正在锁的事务

SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCKS;

查看等待锁的事务

SELECT * FROM INFORMATION_SCHEMA.INNODB_LOCK_WAITS;

文章来源于自己总结和网络转载,内容如有任何问题,请大佬斧正!联系我