In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly shows you "how to achieve read lock and write lock in MySQL". The content is easy to understand and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to achieve read lock and write lock in MySQL".
For the locking mode of read and write locks in MySQL database, the locking and unlocking of tables are realized by using LOCK TABLE and UNLOCK TABLE.
The specific lock types are as follows:
READ normal read lock
WRITE normal write lock
UNLOCK releases the interactive lock type of the lock request
IGNORE is used interactively when a lock request occurs, and there is no information stored in the lock structure and queue.
READ WITH SHARED_LOCKS is used in InnoDB, and the syntax is: select. Lock in share mode
READ_HIGH_PRIORITY High priority read Lock
WRITE_LOW_PRIORITY low priority write lock, generated by setting LOW_PRIORITY_UPDATE=1
READ_NO_INSERT does not allow locking of Concurrent Insert
The WRITE_ALLOW_WRITE type is actually handled by the storage engine itself, and MySQL allows other threads to acquire read or write locks, even if there is a resource conflict, the storage engine handles it itself.
WRITE_ALLOW_READ this kind of locking occurs when the DDL operation on the table, MySQL can allow other threads to obtain the read lock, because MySQL achieves this function by rebuilding the entire table and then RENAME, so the process table can still provide read services.
The locking method used when WRITE_CONCURRENT_INSERT is running Concurrent Insert, and any read lock request other than READ_NO_INSERT will not be blocked when the lock is in progress
The type of locking that occurs when WRITE_DELAYED uses INSERT DELEAYED
WRITE_ONLY when a lock is interrupted abnormally during the operation, the CLOSE TABLE operation needs to be carried out within the system. The lock type that occurs in this process is WRITE_ONLY.
The above is all the content of the article "how to achieve read lock and write lock in MySQL". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.