Skip to content

Commit 057d527

Browse files
committed
fix: deprecation warning message, replace mysql by mariadb command
1 parent 8e58d7a commit 057d527

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/helper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func testDatabaseConnection(db *dbConfig) {
7474
utils.Info("Connecting to %s database ...", db.dbName)
7575
// Set database name for notification error
7676
utils.DatabaseName = db.dbName
77-
cmd := exec.Command("mysql", "-h", db.dbHost, "-P", db.dbPort, "-u", db.dbUserName, db.dbName, "-e", "quit")
77+
cmd := exec.Command("mariadb", "-h", db.dbHost, "-P", db.dbPort, "-u", db.dbUserName, db.dbName, "-e", "quit")
7878
// Capture the output
7979
var out bytes.Buffer
8080
cmd.Stdout = &out

pkg/restore.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func RestoreDatabase(db *dbConfig, conf *RestoreConfig) {
124124
extension := filepath.Ext(filepath.Join(tmpPath, conf.file))
125125
// Restore from compressed file / .sql.gz
126126
if extension == ".gz" {
127-
str := "zcat " + filepath.Join(tmpPath, conf.file) + " | mysql -h " + db.dbHost + " -P " + db.dbPort + " -u " + db.dbUserName + " " + db.dbName
127+
str := "zcat " + filepath.Join(tmpPath, conf.file) + " | mariadb -h " + db.dbHost + " -P " + db.dbPort + " -u " + db.dbUserName + " " + db.dbName
128128
_, err := exec.Command("sh", "-c", str).Output()
129129
if err != nil {
130130
utils.Fatal("Error, in restoring the database %v", err)
@@ -136,7 +136,7 @@ func RestoreDatabase(db *dbConfig, conf *RestoreConfig) {
136136

137137
} else if extension == ".sql" {
138138
// Restore from sql file
139-
str := "cat " + filepath.Join(tmpPath, conf.file) + " | mysql -h " + db.dbHost + " -P " + db.dbPort + " -u " + db.dbUserName + " " + db.dbName
139+
str := "cat " + filepath.Join(tmpPath, conf.file) + " | mariadb -h " + db.dbHost + " -P " + db.dbPort + " -u " + db.dbUserName + " " + db.dbName
140140
_, err := exec.Command("sh", "-c", str).Output()
141141
if err != nil {
142142
utils.Fatal("Error in restoring the database %v", err)

0 commit comments

Comments
 (0)