如下所示,我查询一条记录,然后主动上锁,但是总是失败,为什么?
mysql> select * from account where id = 5;
+----+-----------+---------+
| id | NAME | balance |
+----+-----------+---------+
| 5 | zhangsang | 1000.00 |
+----+-----------+---------+
1 row in set (0.00 sec)
mysql> select * from account where id = 5 for update;
ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction