MySQL Error: Unable to Connect to Host
Issue
While testing a connection, the following errors appear:
Error: Unable to connect to hostConnection error: Connect timed out
Environment
Connector: MySQL
Resolution
To resolve this issue, do the following:
- Confirm that the MySQL server is running and configured to accept external connections. Ensure it is listening on the correct network interface.
- Make sure your database's port (usually
3306) is open to inbound traffic from Fivetran's IP addresses and that your local firewall allows connections to this port. To test connectivity, run the following command, replacing<hostIP>and<port>with the relevant values:telnet <hostIP> <port> - Verify that your MySQL server is accessible using a public IP address. If it's on a private network, configure your router to redirect connections to the MySQL port.
- In Fivetran, click Save & Test.
Cause
This issue occurs when we're unable to reach your MySQL server due to one or more of the following reasons:
- Your server isn't running or isn't configured to allow external connections.
- Firewall rules are blocking traffic on the MySQL port.
- The server isn't accessible through a public IP address, or port forwarding isn't configured.