This article describes how to use a local computer to connect to your MySQL databases stored remotely on ViniHost servers.
You can use either of the following methods to access your MySQL databases remotely:
If you want to use a direct connection, please open a support ticket on the ViniHost Customer Portal at my.a2hosting.com. In the ticket, specify that you want to enable inbound access to MySQL port 3306 for your account.
The procedure you follow to set up an SSH tunnel between your local computer and the ViniHost server depends on the local computer's operating system.
In order to use an SSH tunnel on a computer running Microsoft Windows, you need an SSH client program. ViniHost recommends using PuTTY, which you can download here.
To set up an SSH tunnel on a computer running Microsoft Windows:
3306
. This is the local port to forward.localhost:3306
.7822
.If a PuTTY security alert about the server's host key appears, click Yes.
When the login as prompt appears, type your ViniHost username, and then type your password. When the remote server's command line prompt appears, the SSH tunnel is established and you can use your MySQL client applications on the local computer.
To set up a direct connection between your local computer and the MySQL server, you must first do three things:
The following procedure demonstrates how to configure a remote ODBC connection:
localhost
. If you are using a direct connection, type the domain or IP address of the remote server.3306
.If you are doing development work on the local computer, a local copy of MySQL may already be running on port 3306. In this case, a connection error may appear.
To work around this issue, create a tunnel with an alternate local port, and then connect to the remote MySQL server on that port.
If you use PuTTY to create the tunnel, use an alternate Source port on the Tunnels configuration page. In this example, port 3307
is being used:
For Mac OS X or Linux, use the following SSH command to create the tunnel with a local port of 3307
:
ssh -p 7822 username@example.com -L 3307:localhost:3306
Create the ODBC connection as previously described, but type 3307
in the Port text box (instead of 3306
).
To view the online documentation for PuTTY, please visit here.
Experience the ViniHost difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.