**1.共享讀鎖**
加鎖
`lock table 表名 read;`
解鎖
`unlock tables`
```
show variables like '%table%';
```
```
show status like '%table%';
table_lock_waited 變量查看鎖擋住的操作數量
```
**獨占寫鎖**
```
lock tables 表名 write;
```
**并發插入**
```
show variables like 'concurrent_insert';
set global concurrent_insert=2;
lock table 表名 read local;
```