我有一个具有 MyISAM 结构的 MySQL 数据库。我知道更新语句会锁定表,但是锁是否会阻止读取或只是阻止其他人插入、删除和更新表?
来自http://dev.mysql.com/doc/refman/5.1/en/internal-locking.html:
MySQL 对 InnoDB 表使用行级锁定,对 MyISAM、MEMORY 和 MERGE 表使用表级锁定。
因此,您将拥有表级写锁,这意味着只有您可以根据http://dev.mysql.com/doc/refman/5.0/en/lock-tables.html访问该表
Only the session that holds the lock can access the table.
Run Code Online (Sandbox Code Playgroud)