The lock understanding in MySQL

Source: Internet
Author: User

1. Purpose: Resolve client concurrent access to your conflict issues
2, the Classification of locks
1. Lock type
1. Read lock (Shared lock)
Query (SELECT): After a lock is read, the table record cannot be changed, but can be queried.
2. Write lock (mutex, exclusive lock)
Update: After the lock is written, no one else can check it.
2, the size of the lock
1, row-level lock: Innodb (Storage engine)
Select: Add read lock, lock 1 rows
Update: Add write lock, lock 1 rows
2. Table level Lock: MyISAM
Select: Read lock, lock 1 sheets, other people can only check, can not change
Update: Add write lock, lock 1 table, other people can not change and can not check

The lock understanding in MySQL

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.