Does MySQL MyISAM lock table lock update lock and prevent reading?

I have a MySQL database with a MyISAM structure. I know that the update instruction locks the table, but does the lock prevent reading, or simply prevent others from inserting, deleting, and updating the table?

+4
source share
2 answers

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

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

So, you will have a table-level lock record, which means 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. 
+3
source

I am not a MySQL expert, but if you want to prevent reading, have you read the LOCK TABLES command?

+1
source

Source: https://habr.com/ru/post/1334508/


All Articles