功能描述
Backup lockA new type of backup lock permits DML during an online backup while preventing operations that could result in an inconsistent snapshot. The new backup lock is supported by
LOCK INSTANCE FOR BACKUP
andUNLOCK INSTANCE
syntax. TheBACKUP_ADMIN
privilege is required to use these statements.通过 Backup Lock 的机制,支持在线备份期间执行DML,防止可能导致快照不一致的操作。
LOCK INSTANCE FOR BACKUP
和UNLOCK INSTANCE
语法支持新的备份锁 。需要授予用户BACKUP_ADMIN
权限。
功能学习
Syntax
LOCK INSTANCE FOR BACKUP; |
LOCK INSTANCE FOR BACKUP
获取实例级别的备份锁,该锁在联机备份期间允许DML,同时防止可能导致快照不一致的操作。
权限
BACKUP_ADMIN
:启用LOCK INSTANCE FOR BACKUP
语句的执行并访问Performance Schema log_status
表。
注意:此外BACKUP_ADMIN
,还需要表SELECT
上的 特权 log_status
才能对其进行访问。
当执行从早期版本到MySQL 8.0的就地升级时, 该BACKUP_ADMIN
特权将自动授予具有该RELOAD
特权的用户 。
create user backup_user@'localhost' identified by 'Zyadmin@123'; |
操作实践
# 会话1 |