当前位置:网站首页>MySQL table read lock
MySQL table read lock
2022-07-25 16:05:00 【Leon_ Jinhai_ Sun】
Add the same read lock to the table session Can read the locking table , But you can't read other tables , You can't write locking tables and other tables .
Different locks session You can read locked tables and other tables , Writing other tables can succeed, but writing locked tables will block , Wait for the lock to release before operation
1、session1: lock table mylock read; -- to mylock Read lock on the meter
2、session1: select * from mylock; -- You can query
3、session1:select * from tdep; -- Cannot access non locked table
4、session2 :select * from mylock; -- You can query There is no lock
5、session2:update mylock set name='x' where id=2; -- Modify blocking , Automatically add line write lock
6、session1:unlock tables; -- Release the watch lock
7、session2:Rows matched: 1 Changed: 1 Warnings: 0 -- Modification execution complete
8、session1:select * from tdep; -- You can visit
边栏推荐
- July 25th, 2022 Daily: Microsoft proposed CodeT: a new SOTA for code generation, with 20 points of performance improvement
- 阿唐的小帮手
- ML - Speech - Introduction to speech processing
- MySQL tutorial 65 data in MySQL operation table
- 共享锁(Shared Lock)
- Mysql读写锁
- Copy a word style template to another document
- 兆骑科创海内外高层次创新创业人才服务平台,双创成果转化平台
- 30 lines write the concurrency tool class yourself (semaphore, cyclicbarrier, countdownlatch)
- What is a physical firewall? What's the effect?
猜你喜欢

Understand "average load"

Matlab simulation of BPSK modulation system (1)

Implementation of recommendation system collaborative filtering in spark

不愧是阿里内部“千亿级并发系统架构设计笔记”面面俱到,太全了

Leetcode - 677 key value mapping (Design)*

推荐系统-协同过滤在Spark中的实现

How Google cloud disk is associated with Google colab
![[server data recovery] data recovery cases of raid information loss caused by unexpected power failure of HP EVA server storage](/img/90/51d86111b918eb60761818110cdec4.jpg)
[server data recovery] data recovery cases of raid information loss caused by unexpected power failure of HP EVA server storage

通用测试用例写作规范

Beyond Compare 4 实现class文件对比【最新】
随机推荐
Beyond Compare 4 实现class文件对比【最新】
Data system partition design - partition and secondary index
墨天轮高分技术文档分享——数据库安全篇(共48个)
面试突击:为什么 TCP 需要 3 次握手?
2022-07-25日报:微软提出CodeT:代码生成新SOTA,20个点的性能提升
Sword finger offer | number of 1 in binary
Leetcode - 359 log rate limiter (Design)
行云管家V6.5.1/2/3系列版本发布:数据库OpenAPI能力持续强化
兆骑科创海内外高层次创新创业人才服务平台,双创成果转化平台
记得那两句话
一文入门Redis
Recommended collection, which is probably the most comprehensive coding method summary of category type features
Equivalent change of resistance circuit (Ⅱ)
Leetcode:528. select randomly according to the weight [ordinary random failure + prefix and dichotomy]
意向锁(Intention Lock)
Pytoch learning notes advanced_ CNN (using perception_module) implements MNIST dataset classification - (comments and results)
阿唐的小帮手
MATLAB optimization tool manopt installation
Pytoch learning notes -- seresnet50 construction
Baseband simulation system experiment of 4pam in Gaussian channel and Rayleigh channel