Home > Database > Mysql Tutorial > How to use mysql global lock

How to use mysql global lock

PHPz
Release: 2023-05-26 12:52:06
forward
1461 people have browsed it

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;
Copy after login

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!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template