我是一个新的MySQL用户。我创建了一个InnoDB数据库系统。
在我的情况下,如果使用select for update,我需要锁定行。但即使我做了很多搜索,我也不明白如何在一个用户加载这一行时为所有用户锁定行。
我使用php连接到mysql数据库。
您能帮我解决这个问题吗?
select ... for update
。SELECT counter_field FROM child_codes FOR UPDATE;
UPDATE child_codes SET counter_field = counter_field + 1;
select col1, col2 from table1 where col3='test' for update