我尝试使用MySQL / PHP在我的应用程序中实现行级锁定。
如此http://dev.mysql.com/doc/refman/5.6/en/innodb-lock-modes.html
中所述但是当我试图执行这些查询时。
SELECT * FROM account WHERE id = 13 LOCK IN SHARE MODE;
SELECT * FROM account WHERE id > 13 FOR UPDATE;
它给了我以下错误:
SELECT * FROM account WHERE id = 13 LOCK IN SHARE MODE
LIMIT 0, 25
MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0, 25' at line 2
我使用的是版本mysql 5.6.23。