Mattermost, Inc.

Failed to ping DB error, while installing

Hello, I am having trouble while installing mattermost on Ubuntu 18.04. I followed the document . When testing the server by: “sudo -u mattermost ./bin/mattermost” I am encountered with an issue as shown below:

{“level”:“error”,“ts”:1583319892.0336497,“caller”:“sqlstore/supplier.go:233”,“msg”:“Failed to ping DB”,“error”:“dial tcp connect: connection refused”,“retrying in seconds”:10}

The configuration which I have in /opt/mattermost/config/config.json is:
“DataSource”: “mmuser:mypassword@tcp(,utf8\u0026readTimeout=30s\u0026writeTimeout=30s”,

Does anyone have any suggestions?

Hi there, @neelteja.

It seems that your Mattermost instance is unable to reach out to the database server that you have configured in your config.json. May I know if the database server is hosted within the same machine or on a different one? Do you happen to have any firewall blocking the Mattermost server from communicating with the database instance?

The easiest way to know if the servers can communicate with each other is to run the following command from your Mattermost instance backend:

echo | telnet 3306

By default, you should be able to get the following result as an example:

vagrant@mattermost:~$ echo | telnet 3306
Connected to
Escape character is '^]'.
Connection closed by foreign host.

Can you please share the outcome of the test? Thanks.