Tunnel to your remote database
posted on: 2010-04-11 21:19:17
One problem that developers often encounter is sometimes you need to test some code with live data. But you don't want to go through the hassle of copying huge amounts of data from your remote web server.
Well a solution to this scenario to tunnel!
(Play music from The Great Escape)
ssh -L 3306:localhost:3306 user@yourserver.com
If you are already running a local database server on port 3306 you will need to stop it first.
# /etc/init.d/mysql stop
Note: If you have trouble restarting your mysql server after you have closed your tunnel. Try restarting programs which were using the tunnel, like apache!
