# \[Solved\] Failed to ping db error

**URL:** <https://forum.mattermost.com/t/solved-failed-to-ping-db-error/1082>\
**Category:** Troubleshooting\
**Created:** [March 17, 2016, 2:56pm UTC](https://forum.mattermost.com/t/solved-failed-to-ping-db-error/1082 "2016-03-17T14:56:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![paryl](https://avatars.discourse-cdn.com/v4/letter/p/977dab/32.png) [@paryl](https://forum.mattermost.com/u/paryl)\
**Post date:** [March 17, 2016, 2:56pm UTC](https://forum.mattermost.com/t/solved-failed-to-ping-db-error/1082/1 "2016-03-17T14:56:13Z")

</div>

Hey there,

I’m setting up Mattermost on my current server without a docker container, and would like to use my existing MySQL install. I added a new user and a ‘mattermost’ database, and I can log in to the database from the command line with no issues.

I set DriverName to “mysql” and DataSource to “username:password@127.0.0.1:3306/mattermost?charset=utf8”.

When I run /opt/mattermost/bin/platform, I get this:

> [10:54:05 EDT 2016/03/17] [INFO] ([github.com/mattermost/platform/utils.GetTranslationsBySystemLocale:52](http://github.com/mattermost/platform/utils.GetTranslationsBySystemLocale:52)) Loaded system translations for ‘en’ from ‘/opt/mattermost/i18n/en.json’  
> [2016/03/17 10:54:05 EDT] [INFO] Current version is 2.1.0 (2.1.0/Mon Mar 14 20:45:23 UTC 2016/f189bc2073cf800c5f4506a69bdb51d7065269bf)  
> [2016/03/17 10:54:05 EDT] [INFO] Enterprise Enabled: false  
> [2016/03/17 10:54:05 EDT] [INFO] Current working directory is /opt/mattermost/bin  
> [2016/03/17 10:54:05 EDT] [INFO] Loaded config file from /opt/mattermost/config/config.json  
> [2016/03/17 10:54:05 EDT] [INFO] Server is initializing…  
> [2016/03/17 10:54:05 EDT] [INFO] Pinging sql master database  
> [2016/03/17 10:54:05 EDT] [CRIT] Failed to ping db err:Default addr for network ‘127.0.0.1:3306’ unknown  
> panic: Failed to open sql connection Default addr for network ‘127.0.0.1:3306’ unknown

I’m not sure what I’m doing wrong, especially since I can connect to my mysql server through the command line client with no issues.

Any thoughts?

---

<div class="post-metadata">

**Author:** ![paryl](https://avatars.discourse-cdn.com/v4/letter/p/977dab/32.png) [@paryl](https://forum.mattermost.com/u/paryl)\
**Post date:** [March 17, 2016, 4:01pm UTC](https://forum.mattermost.com/t/solved-failed-to-ping-db-error/1082/2 "2016-03-17T16:01:29Z")

</div>

In case this helps anyone, I realized my issue.

My DataSource was set to “username:password@127.0.0.1:3306/mattermost” but it should have been “username:password@tcp(127.0.0.1:3306)/mattermost”.

---

<div class="post-metadata">

**Author:** ![farahfa](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/farahfa/32/1641_2.png) [@farahfa](https://forum.mattermost.com/u/farahfa)\
**Post date:** [August 24, 2016, 7:40am UTC](https://forum.mattermost.com/t/solved-failed-to-ping-db-error/1082/3 "2016-08-24T07:40:22Z")

</div>

That helps a lot! Thanks!

---

<div class="post-metadata">

**Author:** ![ylluminate](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/ylluminate/32/2253_2.png) [@ylluminate](https://forum.mattermost.com/u/ylluminate)\
**Post date:** [July 16, 2018, 5:24am UTC](https://forum.mattermost.com/t/solved-failed-to-ping-db-error/1082/4 "2018-07-16T05:24:07Z")

</div>

Good to see that as a reminder. This should be the default or there should be a comment to make things a bit more clear here.
