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 ju开发者_StackOverflow中文版st 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.
I'm not a MySQL expert but if you want to prevent reads have you read about the LOCK TABLES
command?
精彩评论