Home > Database > Mysql Tutorial > What are the four locking scopes of mysql InnoDB

What are the four locking scopes of mysql InnoDB

王林
Release: 2023-05-26 23:04:08
forward
1681 people have browsed it

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;
Copy after login

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template