How to Access Your MySQL Server Remotely Over SSH

Filed in Debian , Open Source 0 comments

So you’ve got MySQL on your web server, but it’s only opened to local ports by default for security reasons. If you want to access your database from a client tool like the MySQL Query Browser, normally you’d have to open up access from your local IP address… but that’s not nearly as secure.

So instead, we’ll just use port-forwarding through an SSH tunnel, so your MySQL client thinks it’s connecting to your localhost machine, but it’s really connecting to the other server through the tunnel.

If you are using the command line ssh, the command would look like this. (You can do the same thing graphically in Putty or SecureCRT options if you need to)

ssh -L 3306:localhost:3306 geek@webserver.com

The syntax is ssh -L <localport>hostname<remoteport> <username>@<servername>. We’re using localhost as the hostname because we are directly accessing the remote mysql server through ssh. You could also use this technique to port-forward through one ssh server to another server.

Read more @ How to Geek


Posted by gokul   @   11 March 2011 0 comments
Tags : , , , , , , , ,

Share This Post

RSS Digg Twitter StumbleUpon Delicious Technorati

0 Comments

Sorry, comments are closed.

Previous Post
«
Next Post
»
© 0000 - 2013 Open Help
Powered by Wordpress
PolkaDot designed by ZENVERSE
In conjunction with Chattrum , Black toaster , Black microwave , Kontantkort