diff --git a/mysqlcluster/syncer/mysql_cm.go b/mysqlcluster/syncer/mysql_cm.go index a419f3b1..943be49b 100644 --- a/mysqlcluster/syncer/mysql_cm.go +++ b/mysqlcluster/syncer/mysql_cm.go @@ -81,7 +81,7 @@ func buildMysqlConf(c *mysqlcluster.MysqlCluster) (string, error) { addKVConfigsToSection(sec, mysql57Configs) } - addKVConfigsToSection(sec, mysqlSysConfigs, mysqlCommonConfigs, mysqlStaticConfigs, c.Spec.MysqlOpts.MysqlConf) + addKVConfigsToSection(sec, mysqlSysConfigs, mysqlCommonConfigs, mysqlStaticConfigs) if c.Spec.MysqlOpts.InitTokuDB { addKVConfigsToSection(sec, mysqlTokudbConfigs) @@ -93,6 +93,12 @@ func buildMysqlConf(c *mysqlcluster.MysqlCluster) (string, error) { } } + for _, para := range c.Spec.MysqlOpts.MysqlConf { + if sec.HasKey(para) { + sec.Key(para).SetValue(c.Spec.MysqlOpts.MysqlConf[para]) + } + } + data, err := writeConfigs(cfg) if err != nil { return "", err