Disobey database host configuration?


In my configuration, the DB host is on the remote host

root@public:/opt/mattermost# ./bin/mattermost config get "SqlSettings"
DataSource: "mattermost:password@tcp(,utf8&readTimeout=30s&writeTimeout=30s"
DataSourceReplicas: "[]"
MaxIdleConns: "20"
MaxOpenConns: "300"
AtRestEncryptKey: "ezw39cnq7rjafxegq4nguk3rgzy3audp"
QueryTimeout: "30"
DriverName: "mysql"
DataSourceSearchReplicas: "[]"
ConnMaxLifetimeMilliseconds: "3600000"
Trace: "false"

But when I run the program, it always to try to connect local host IP address ( instead of remote DB host (

root@public:/opt/mattermost# ./bin/mattermost 
{"level":"info","ts":1561978741.348163,"caller":"utils/i18n.go:83","msg":"Loaded system translations for 'en' from '/opt/mattermost/i18n/en.json'"}
{"level":"info","ts":1561978741.3484783,"caller":"app/server_app_adapters.go:58","msg":"Server is initializing..."}
{"level":"info","ts":1561978741.356139,"caller":"sqlstore/supplier.go:224","msg":"Pinging SQL master database"}
{"level":"error","ts":1561978741.3588479,"caller":"sqlstore/supplier.go:236","msg":"Failed to ping DB retrying in 10 seconds err=Error 1045: Access denied for user 'mattermost'@'' (using password: YES)"}

Steps to reproduce

  • Setup database on other machine (

  • Configure the config.json to pointing the remote DB machine

    ./bin/mattermost config set SqlSettings.DataSource mattermost:password@tcp(,utf8&readTimeout=30s&writeTimeout=30s
  • Run ./bin/mattermost

Expected behavior

Target DB host should be same in as written in the config file (

Observed behavior

Target DB host same as the local host (

Did you ever get this resolved?