Can't connect MySQL due to time-out but works on Workbench

Hi everyone,

I am trying to connect MySQL to Metabase but keep getting an error that it is timed-out (see log message).

I set up the connection using our database settings as well as a SSH with private key - settings do work on my computer when using MySQL Workbench.

What can I do to fix this?

[74e29543-9390-42a5-8aa6-761e329cc0d5] 2020-09-10T12:23:49+02:00 DEBUG metabase.middleware.log GET /api/database 200 985.5 µs (1 DB calls) App DB connections: 0/7 Jetty threads: 4/50 (2 idle, 0 queued) (50 total active threads) Queries in flight: 0 (0 queued) [74e29543-9390-42a5-8aa6-761e329cc0d5] 2020-09-10T12:23:57+02:00 ERROR metabase.driver.util Database connection error [74e29543-9390-42a5-8aa6-761e329cc0d5] 2020-09-10T12:23:57+02:00 ERROR metabase.api.database Cannot connect to Database [74e29543-9390-42a5-8aa6-761e329cc0d5] 2020-09-10T12:24:02+02:00 ERROR metabase.driver.util Database connection error [74e29543-9390-42a5-8aa6-761e329cc0d5] 2020-09-10T12:24:02+02:00 ERROR metabase.api.database Cannot connect to Database [74e29543-9390-42a5-8aa6-761e329cc0d5] 2020-09-10T12:24:02+02:00 DEBUG metabase.middleware.log POST /api/database 400 10.0 s (0 DB calls) {:valid false, :dbname “Timed out after 5.0 s”, :message “Timed out after 5.0 s”}

Hi @MrOrange
Normally the timeout error has something to do with bad network connection - wrong host or port, or a firewall is blocking something.
If you’re using a SSH tunnel, then you need to connect to the host inside of the tunnel.

Thanks! I actually was using the wrong host, got mixed up, got it to work!

1 Like