Can't connect to mysql database


I’m new to Metabase. Trying to connect to a MySql 6.5 database on my network. I installed Metabase locally on my MacBook and also launched a Metabase Docker container and can’t connect either to the MySql database. From each instance I get

Couldn’t connect to the database. Please check the connection details

I can connect to the database with MySqlWorkbench using the same connection info.

Is this a common problem with a common solution? Or, is there more detailed logging available in Metabase?



Hi & welcome!

The more detailed logs are available in the UI in the top right menu.

Sounds like you are already halfway there with troubleshooting. :+1: The :blue_book: Troubleshooting Guide has a few more steps for you to try in the Connecting to databases and data warehouses with Metabase section.


Thanks jornh. The logs were helpful. On both my local install and my network Docker install I’m getting a similar error:
Failed to connect to database: java.sql.SQLException: Access denied for user '_username_'@'x.x.x.x' (using password: YES)

where x.x.x.x is the IP address of the machine running Metabase, not the IP address of the database server I entered on the config screen.

So when attempting to make the connection, Metabase appears to be using the proper database username but is replacing the DB server IP address I specified with the local machine IP.

There was nothing in the troubleshooting guide about this. Any suggestions are appreciated.


One other thing…the Docker container appears to have network connectivity, I was able to drop into the container and ping out to the database server:

[root@todd ~]# docker exec -it de3 ping x.x.x.x
PING x.x.x.x (x.x.x.x): 56 data bytes
64 bytes from x.x.x.x: seq=0 ttl=63 time=0.424 ms


Are you by any chance running this with SSL/SSH tunnel? Think there was an issue open on GitHub related to this… edit this: (exec with an unmerged PR)

Also, it could help understanding your environment better if you shared (somewhat redacted/obfuscated) settings.