当前位置:网站首页>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
边栏推荐
- mysql 表读锁
- 乐观锁悲观锁适用场景
- 如何构建面向海量数据、高实时要求的企业级OLAP数据引擎?
- Analysis and solution of data and clock mismatch delay in SPI transmission
- [server data recovery] data recovery cases of raid information loss caused by unexpected power failure of HP EVA server storage
- mysql 表写锁
- 「数字安全」警惕 NFT的七大骗局
- How Google cloud disk is associated with Google colab
- Release of v6.5.1/2/3 series of versions of Xingyun housekeeper: the ability of database OpenAPI continues to be strengthened
- R语言偏相关性计算(Partial Correlation)、使用ggm包的pcor函数计算偏相关性(Partial Correlations)
猜你喜欢

The second revolution of reporting tools

JWT diagram

Product dynamics - Android 13 high-efficiency adaptation new upgrade

CircleIndicator组件,使指示器风格更加多样化

ML - Speech - traditional speech model

Leetcode - 641 design cycle double ended queue (Design)*

Ice 100g network card fragment message hash problem

Redis distributed lock, it's really impossible without it

HDD Hangzhou station · harmonyos technical experts share the features of Huawei deveco studio
![Leetcode:6127. Number of high-quality number pairs [bit operation finding rules + the sum of two numbers is greater than or equal to K + dichotomy]](/img/b5/5c7fc70b8025cf7ef21d645a3ac22e.png)
Leetcode:6127. Number of high-quality number pairs [bit operation finding rules + the sum of two numbers is greater than or equal to K + dichotomy]
随机推荐
十字链表的存储结构
How matlab produces random complex sequences
Golang review summary
Pytoch learning notes -- Summary of common functions 3
Huawei 2023 starts to warm up in advance! Zuo Shen's program code interview guide comes in handy
Visual studio 2022 view class diagram
MySQL隐式锁
PageHelper.startPage没有生效问题
Pytoch learning notes advanced_ CNN (using perception_module) implements MNIST dataset classification - (comments and results)
MySQL全局锁
Leetcode - 379 telephone directory management system (Design)
R语言使用gt包和gtExtras包漂亮地显示表格数据:gt_bar_plot函数和gt_plt_bar_pct函数可视化百分比条形图、原始数据的百分比条形、缩放后的数据的百分比条形、指定数据对齐宽度
MySQL-自增锁
面试突击:为什么 TCP 需要 3 次握手?
HDD杭州站·HarmonyOS技术专家分享HUAWEI DevEco Studio特色功能
权限管理-删除菜单(递归)
Matlab -- CVX optimization kit installation
共享锁(Shared Lock)
ML - Speech - traditional speech model
Leetcode - 380 o (1) time to insert, delete and get random elements (design hash table + array)