Skip to content

Commit

Permalink
Added flags to mysqldump for performance
Browse files Browse the repository at this point in the history
  • Loading branch information
LobbyLobster committed Feb 14, 2024
1 parent 8571405 commit f0c4f21
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backup/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,17 @@ func dumpMySQLDb(db string, dst string, params config.Params, logger Logger) (st

var mysqlArgs []string
if params.Remote.IsRemote {
mysqlArgs = append(mysqlArgs, "-h"+params.Remote.Host, "--port="+params.Remote.Port, "-u"+params.Remote.User, "-p"+params.Remote.Password, db)
mysqlArgs = append(mysqlArgs, "-h"+params.Remote.Host, "--port="+params.Remote.Port, "-u"+params.Remote.User, "-p"+params.Remote.Password)
} else {
mysqlArgs = append(mysqlArgs, "-u"+params.Remote.User, "-p"+params.Remote.Password, db)
mysqlArgs = append(mysqlArgs, "-u"+params.Remote.User, "-p"+params.Remote.Password)
}
date := rightNow{
year: time.Now().Format("2006"),
month: time.Now().Format("01"),
}

mysqlArgs = append(mysqlArgs, "--single-transaction", "--quick", "--skip-lock-tables", "--routines", "--triggers", db)

if db == "mysql" {
mysqlArgs = append(mysqlArgs, "user")
name = dumpName(db+"_users", params.Rotation)
Expand Down

0 comments on commit f0c4f21

Please sign in to comment.