SSH Tunneling for MySQL connection
PHP October 17th, 2007
In most cases you are allowed to change the settings in your MySQL server to allow outside connections . If this is not the case (security purposes) and you have SSH access to the server you can create a Tunnel.
Just follow these quick steps:
1). Get Putty if you don’t have it already.
2). Inside of Putty fill in the host information and port number. Then, click on Tunnels from the left navigation.
![]()
3). Inside of Tunnels you need to enter the source port. In this case we can put 3306. But make sure that is the correct port number of your mySQL sever. In the destination box you can to put: localhost:3306
Localhost is the path were the traffic is going to get redirected too. 3306 is the port number of the mySQL server in the machine. Click ADD after you have entered the information.
![]()
4). Click on Open and the enter the server credentials. Leave this window open while you use your favorite MySQL interface.
5). Open a mySQL GUI and in the host you are going to put your local host servername. In this case we are using “localhost” and the mysql server credentials.
![]()
Posts
Leave a Comment
You must be logged in to post a comment.