Home >Database >Mysql Tutorial >What are the four locking scopes of mysql InnoDB
1. Record lock, lock the records in the index.
2. Gap lock.
Either lock the value in the middle of the index record, lock the value before the first index record, or lock the value after the last index record.
3. The temporary key lock is a combination of the record lock on the index record and the gap lock before the index record.
4. Insert the intention lock and add the record id lock during the insert operation.
Example
-- id 列为主键列或唯一索引列 UPDATE SET age = 50 WHERE id = 1;
The above is the detailed content of What are the four locking scopes of mysql InnoDB. For more information, please follow other related articles on the PHP Chinese website!