# Mysql Rancher cannot connect

**URL:** <https://forums.suse.com/t/mysql-rancher-cannot-connect/7823>\
**Category:** Rancher 1.x\
**Created:** [November 17, 2017, 2:32pm UTC](https://forums.suse.com/t/mysql-rancher-cannot-connect/7823 "2017-11-17T14:32:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skater101b](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@Skater101b](https://forums.suse.com/u/Skater101b)\
**Post date:** [November 17, 2017, 2:32pm UTC](https://forums.suse.com/t/mysql-rancher-cannot-connect/7823/1 "2017-11-17T14:32:35Z")

</div>

I am using the rancher/server:stable and my command looks like this.

sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server:stable --db-host dbHostname --db-port 3306 --db-user dbUser --db-pass dbPassword --db-name cattle

I created the database per the instructions online. I am starting rancher via the command above. I am getting the error below.

org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Could not connect to address=(host=dbHostname)(port=3306)(type=master) : dbHostname)

1. If I try connecting remotely to the cattle db via the rancher host. It works just fine.

Is there a way to get additional details about why it will not connect?

---

<div class="post-metadata">

**Author:** ![Skater101b](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@Skater101b](https://forums.suse.com/u/Skater101b)\
**Post date:** [November 17, 2017, 3:30pm UTC](https://forums.suse.com/t/mysql-rancher-cannot-connect/7823/2 "2017-11-17T15:30:51Z")

</div>

I managed to fix the issue. After looking deeper in the stack trace I saw UnknownHost. Which I thought was odd, so I added the --dns=x.x.x.x to the start up and still got the same thing. Then I tried the IP and got a timeout error.

I started up a vanilla centos container and tried to ping google. I couldn’t. That explains why the host was not found and it timed out on the IP. It wasn’t getting any networking. I uninstalled docker, re-installed and started the rancher container and wallah. It all worked out.
