当前位置:网站首页>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
边栏推荐
- Golang review summary
- Alibaba's internal "100 billion level concurrent system architecture design notes" are all inclusive, too comprehensive
- SVD singular value decomposition derivation and application and signal recovery
- 基于Caffe ResNet-50网络实现图片分类(仅推理)的实验复现
- Upgrade esxi6.7.0 to 7.0u3f (updated on July 12, 2022)
- MySQL tutorial 67- filter duplicate data using distinct
- Why is preparestatement better and safer?
- Boomi荣获“多元化最佳首席执行官奖”和“职业成长最佳公司奖”,在大型公司类别中跻身50强
- 物理防火墙是什么?有什么作用?
- 一文入门Redis
猜你喜欢

电阻电路的等效变化(Ⅱ)

The second revolution of reporting tools

Storage structure of cross linked list

Leetcode - 380 o (1) time to insert, delete and get random elements (design hash table + array)

Understand "average load"

Ml image depth learning and convolution neural network

基于Caffe ResNet-50网络实现图片分类(仅推理)的实验复现

Boomi荣获“多元化最佳首席执行官奖”和“职业成长最佳公司奖”,在大型公司类别中跻身50强

报表工具的二次革命

Product dynamics - Android 13 high-efficiency adaptation new upgrade
随机推荐
Recommended collection, which is probably the most comprehensive coding method summary of category type features
通用测试用例写作规范
Beyond Compare 4 实现class文件对比【最新】
How matlab saves all the data after running
[Shakespeare: keep the fun of being a man]
MySQL tutorial 67- filter duplicate data using distinct
[IJCAI 2022] parameter efficient large model sparse training method, which greatly reduces the resources required for sparse training
Upgrade esxi6.7.0 to 7.0u3f (updated on July 12, 2022)
Ice 100g network card fragment message hash problem
Wavelet transform --dwt2 and wavedec2
Save the image with gaussdb (for redis), and the recommended business can easily reduce the cost by 60%
【IJCAI 2022】参数高效的大模型稀疏训练方法,大幅减少稀疏训练所需资源
Crazy God redis notes 12
Equivalent change of resistance circuit (Ⅱ)
R语言ggplot2可视化线图(line)、自定义配置标题文本相关内容颜色和图例(legend)颜色相匹配(和分组线图的颜色相匹配、match colors of groups)
面试8家公司,1周拿了5个offer,分享一下自己的心得
JWT diagram
权限管理-角色分配菜单
[JS advanced] JS regular correlation functions and regular objects_ 02
泰雷兹推出解决方案,助力SAP客户控制云端数据