diff --git a/pkg/helper.go b/pkg/helper.go index 215c737..3f311e4 100644 --- a/pkg/helper.go +++ b/pkg/helper.go @@ -74,7 +74,7 @@ func testDatabaseConnection(db *dbConfig) { utils.Info("Connecting to %s database ...", db.dbName) // Set database name for notification error utils.DatabaseName = db.dbName - cmd := exec.Command("mysql", "-h", db.dbHost, "-P", db.dbPort, "-u", db.dbUserName, db.dbName, "-e", "quit") + cmd := exec.Command("mariadb", "-h", db.dbHost, "-P", db.dbPort, "-u", db.dbUserName, db.dbName, "-e", "quit") // Capture the output var out bytes.Buffer cmd.Stdout = &out diff --git a/pkg/restore.go b/pkg/restore.go index a8bc46f..611e6ae 100644 --- a/pkg/restore.go +++ b/pkg/restore.go @@ -124,7 +124,7 @@ func RestoreDatabase(db *dbConfig, conf *RestoreConfig) { extension := filepath.Ext(filepath.Join(tmpPath, conf.file)) // Restore from compressed file / .sql.gz if extension == ".gz" { - str := "zcat " + filepath.Join(tmpPath, conf.file) + " | mysql -h " + db.dbHost + " -P " + db.dbPort + " -u " + db.dbUserName + " " + db.dbName + str := "zcat " + filepath.Join(tmpPath, conf.file) + " | mariadb -h " + db.dbHost + " -P " + db.dbPort + " -u " + db.dbUserName + " " + db.dbName _, err := exec.Command("sh", "-c", str).Output() if err != nil { utils.Fatal("Error, in restoring the database %v", err) @@ -136,7 +136,7 @@ func RestoreDatabase(db *dbConfig, conf *RestoreConfig) { } else if extension == ".sql" { // Restore from sql file - str := "cat " + filepath.Join(tmpPath, conf.file) + " | mysql -h " + db.dbHost + " -P " + db.dbPort + " -u " + db.dbUserName + " " + db.dbName + str := "cat " + filepath.Join(tmpPath, conf.file) + " | mariadb -h " + db.dbHost + " -P " + db.dbPort + " -u " + db.dbUserName + " " + db.dbName _, err := exec.Command("sh", "-c", str).Output() if err != nil { utils.Fatal("Error in restoring the database %v", err)