开发者

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

开发者 https://www.devze.com 2023-02-03 08:39 出处:网络
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 &

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消