Fix mysql restoration
Password and database weren't passed to the mysql command
This commit is contained in:
parent
0de267a4cf
commit
1d6957f45f
6
tasks.go
6
tasks.go
@ -165,7 +165,11 @@ func (t JobTaskMySQL) GetPostTask() ExecutableTask {
|
||||
}
|
||||
|
||||
if t.Password != "" {
|
||||
command = append(command, "--password", t.Password)
|
||||
command = append(command, fmt.Sprintf("--password=%s", t.Password))
|
||||
}
|
||||
|
||||
if t.Database != "" {
|
||||
command = append(command, t.Database)
|
||||
}
|
||||
|
||||
command = append(command, "<", t.DumpToPath)
|
||||
|
@ -163,7 +163,7 @@ func TestJobTaskSql(t *testing.T) {
|
||||
" --user user --password=pass --no-tablespaces db table1 table2",
|
||||
postBackup: "",
|
||||
preRestore: "",
|
||||
postRestore: "mysql --host host --user user --password pass < ./simple.sql",
|
||||
postRestore: "mysql --host host --user user --password=pass db < ./simple.sql",
|
||||
},
|
||||
// Sqlite
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user