【发布时间】:2023-03-20 03:28:01
【问题描述】:
我遇到了一些表锁定问题。我在事务中锁定了一定数量的表。 LOCK TABLES t1 READ, t2 READ, t3 READ, t4 READ,t5 READ,t6 READ,t7 READ;
虽然读取它没问题,但是当我尝试写入/更新此表时,它显示错误 Table 't1' is locked with a READ lock and can't be updated
但我从未锁定表进行写入,我必须使用更新的值写入这些表。
我的目标是我需要选择并且我需要更新行,而其他人不应该在过程完成之前与上面的表格进行交互。
非常感谢您的解决方案!
【问题讨论】:
-
RTFM:dev.mysql.com/doc/refman/5.0/en/lock-tables.html
The session that holds the lock can read the table (but not write it).
标签: mysql error-handling table-lock