View Single Post
Old 02-27-07, 04:43 PM   #4
evilghost
Registered User
 
Join Date: Jul 2005
Posts: 3,606
Default Re: VPN'ing local and remote mysql servers.

Quote:
Originally Posted by fivefeet8
How would that be done? Both local and remote servers are running Unix based OS's with mysql.
[From Local Machine]
ssh -f -C username@remote_machine_ip -L 33060:local_ip_of_remote_machine:3306 -N

This would bind the local TCP socket of 33060 to MySQL on the remote machine.

Basically, you would point the application to localhost:33060 and this in turn would tunnel traffic across SSH with compression enabled to the remote machine on dport 3306.

You could use key-based authentication to avoid having to enter a username/password.
evilghost is offline   Reply With Quote