当前位置:网站首页>MySQL table read lock
MySQL table read lock
2022-07-26 06:50: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
边栏推荐
- [image denoising] image denoising based on bicube interpolation and sparse representation matlab source code
- XSS-labs(1-10)闯关详解
- UIToolkit中显示汉字
- How does the national standard gb28181 protocol easygbs platform realize device video recording and set streaming IP?
- Regular expressions and calling related functions in C language
- Display Chinese characters in uitoolkit
- 123123123
- What are the main reasons for server crash
- [graduation season _ advanced technology Er] farewell to yourself who has been confused for the past two years. Regroup, junior I'm coming
- Esxi 7.0 installation supports mellanox technologies mt26448 [connectx en 10gige, PCIe 2.0 5gt/s] driver, and supports the cheapest 10GB dual fiber network card
猜你喜欢

【Web3 系列开发教程——创建你的第一个 NFT(4)】NFTs 可以给你带来什么

排序问题:冒泡排序,选择排序,插入排序

TCP protocol -- message format, connection establishment, reliable transmission, congestion control

『牛客|每日一题』逆波兰表达式

vulnhub Lampião: 1
![[hardware ten treasures] - 7.1 [dynamic RAM] key points of DDR hardware design](/img/ba/87cd3b1600bcb6f2839e7bb093ff62.png)
[hardware ten treasures] - 7.1 [dynamic RAM] key points of DDR hardware design

Children's programming electronic society graphical programming level examination scratch level 1 real problem analysis (multiple choice) June 2022

『HarmonyOS』DevEco的下载安装与开发环境搭建

【毕业季_进击的技术er】送别过去两年迷茫的自己。重整旗鼓,大三我来啦

LeetCode刷题1:题目分类
随机推荐
[graduation season _ advanced technology Er] farewell to yourself who has been confused for the past two years. Regroup, junior I'm coming
Ruby on rails Code Execution Vulnerability (cve-2020-8163) technical analysis, research, judgment and protection
On stock price prediction model (3): are you falling into the trap of machine learning
原生高性能抓包工具Proxyman,送给爱学习的你
日志轮转logrotate
Which "digital currencies" can survive this winter? 2020-03-30
Regular expressions and calling related functions in C language
CONDA virtual environment envs directory is empty
Database and the future of open source
[hard ten treasures] - 7.2 [dynamic RAM] analysis of the difference between DDR4 and DDR3
buuReserve(4)
Database performance test (MySQL)
打开服务器上的 IncludeExceptionDetailInFaults (从 ServiceBehaviorAttribute 或从 <serviceDebug> 配置行为)以便将异常信息发送回
Downloadutilse tool class without error
Development stage of source code encryption technology
源代码加密技术发展阶段
Rust语言- Slice(切片)类型(&[u8])
『HarmonyOS』探索HarmonyOS应用
[image denoising] image denoising based on bicube interpolation and sparse representation matlab source code
[Star Project] small hat aircraft War (IV)