From c36104a0751b2f22c7d56edf85ba9b003fb6d806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Fri, 28 Jun 2024 03:25:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8E=BB=E6=8E=89mysql=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E7=9A=84=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/services/backup.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/services/backup.go b/internal/services/backup.go index 5c0b0d93..4ec023d0 100644 --- a/internal/services/backup.go +++ b/internal/services/backup.go @@ -165,7 +165,7 @@ func (s *BackupImpl) MysqlBackup(database string) error { return err } - if _, err := shell.Execf("/www/server/mysql/bin/mysqldump -uroot " + database + " > " + backupPath + "/" + backupFile); err != nil { + if _, err := shell.Execf("mysqldump -uroot " + database + " > " + backupPath + "/" + backupFile); err != nil { return err } if _, err := shell.Execf("cd " + backupPath + " && zip -r " + backupPath + "/" + backupFile + ".zip " + backupFile); err != nil { @@ -219,7 +219,7 @@ func (s *BackupImpl) MysqlRestore(database string, backupFile string) error { return errors.New("无法找到备份文件") } - if _, err = shell.Execf("/www/server/mysql/bin/mysql -uroot " + database + " < " + filepath.Join(tempDir, backupFile)); err != nil { + if _, err = shell.Execf("mysql -uroot " + database + " < " + filepath.Join(tempDir, backupFile)); err != nil { return err }