1. Global lock locks the entire database. After locking, the entire instance will be in a read-only state.
2. Subsequent MDL writing sentences, DDL sentences, and updated transaction commit sentences will be blocked. Its typical usage scenario is to make a logical backup of the entire database.
Lock all tables to obtain a consistent view and ensure data integrity.
Example
# 全局锁,简称FTWRL FLUSH TABLES WITH READ LOCK; # 解锁命令 UNLOCK TABLES;
The above is the detailed content of How to use mysql global lock. For more information, please follow other related articles on the PHP Chinese website!