Skip to content

[Bug] Locking table issue during backup of large MySQL database #11569

@uouuou

Description

@uouuou

Contact Information

uouuou@foxmail.com

1Panel Version

v2.0.16

Problem Description

我的数据库是MySQL8.4.7有47GB,每次在备份的时候都有2分钟服务宕机,通过排查发现在:
https://github.com/1Panel-dev/1Panel/blob/dev-v2/agent/utils/mysql/client/local.go 这个文件下备份时候使用mysqldump的时候没有自定义参数功能,这导致大数据库在使用mysqldump备份的时候锁表,在InnoDB模式下因该允许用户使用:

--single-transaction 
--quick 
--skip-lock-tables

这样的方式使用快照备份来避免这个问题确保业务正常运转

Steps to Reproduce

一个大型MYSQL数据库直接备份

The expected correct result

No response

Related log output

Additional Information

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions