I can't connect using a SSH tunnel, but I know my credentials are correct

February 9, 2021 in Database Backup

When using an SSH tunnel, there are three additional configuration steps that may be required by your hosting provider or system administrator.

1. The SSH tunnel option depends on the ability to map a port on your server to a local port on our backup server through the SSH connection. If the database is only listening on a local socket and not available on a TCP port, then we are not able to create that mapping. In order for this process to work successfully, your database must be listening on a TCP port like 3306.

2. It is possible that your host is configured to allow SSH, but tunneling is prohibited by the firewall rules. Specifically, these firewall rules impact outbound traffic from the loopback address ( Your system administrator or hosting provider should be able to update the firewall rules to allow for traffic leaving the host via a tunnel.

3. Finally, the MySQL user grants may be restricting access. When CodeGuard connects to your database through a tunnel, we specify as the MySQL server hostname. If your MySQL user is only granted access to connect using 'localhost' then the connection attempt may be rejected. You can test this from the MySQL prompt with the "SHOW GRANTS FOR CURRENT_USER;" command. You should see something like:


If you only see an entry for [email protected] and not [email protected] or [email protected]%, then you'll need to add a grant for that user to connect with the address This can be done with the following command: "GRANT ALL PRIVILEGES ON . TO 'myuser'@'' WITH GRANTOPTION;"