简体   繁体   中英

MySQL MyISAM does an update statment lock the table and prevent reading?

I have MySQL database with a MyISAM structure. I know the update statement locks the table but does the lock prevent reading or just prevent others from inserting, deleting & updating the table?

from http://dev.mysql.com/doc/refman/5.1/en/internal-locking.html :

MySQL uses row-level locking for InnoDB tables, and table-level locking for MyISAM, MEMORY, and MERGE tables.

So you'll have a table-level write-lock, which means only you can access the table according to http://dev.mysql.com/doc/refman/5.0/en/lock-tables.html

Only the session that holds the lock can access the table.

我不是MySQL专家,但是如果你想防止读取,你有没有读过LOCK TABLES命令?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM