https://blog.51cto.com/u_16099315/8164586

执行如下语句,就可以锁定行(在查询语句最后加上 for update 即可);

select * from test_innodb_lock_tbl where a=101 for update;