Skip to content

Commit

Permalink
fix(dbm-services): use mysql bin path #8372
Browse files Browse the repository at this point in the history
  • Loading branch information
ymakedaq authored and iSecloud committed Dec 3, 2024
1 parent 3ce0bc0 commit 36d19fc
Showing 1 changed file with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,21 +142,14 @@ func (c *SemanticDumpSchemaComp) Init() (err error) {
logger.Error("获取version failed %s", err.Error())
return err
}
enableGtid, err := conn.IsEnableGtid()
if err != nil {
logger.Warn("获取gtid模式失败 %s", err.Error())
enableGtid = true
}
c.gtidPurgedOff = enableGtid

c.isSpider = strings.Contains(version, "tdbctl")
c.dumpCmd = path.Join(cst.MysqldInstallPath, "bin", "mysqldump")
if c.gtidPurgedOff {
c.useTmysqldump = false
} else if cmutil.FileExists("/home/mysql/dbbackup/mysqldump_x86_64") {
c.dumpCmd = "/home/mysql/dbbackup/mysqldump_x86_64"
c.isSpider = strings.Contains(version, "tdbctl")
if strings.Contains(version, "tmysql") {
c.useTmysqldump = true
}
if cmutil.MySQLVersionParse(version) > cmutil.MySQLVersionParse("5.6.9") {
c.gtidPurgedOff = true
}
// to export the table structure from the central control
// you need to use the mysqldump that comes with the central control
if c.isSpider {
Expand Down

0 comments on commit 36d19fc

Please sign in to comment.