[Last Call] Learn how to a build a cloud-first strategyRegister Now


Connect to MySQL Via SSH Tunnel

Posted on 2011-10-20
Medium Priority
Last Modified: 2012-05-12
Hi all,

I need to connect to mySql on a remote server via SSH but cannot get it to work.

I don't know what I need to do to get it working.

I have a mySQL client app for windows that won't connect. So I've tried putty and THEN the client but still no connection.

I've talked to my host and they've said I just need to connect.

Can anyone provide a simple instruction for dummies please?

Question by:error77
LVL 84

Expert Comment

by:Dave Baldwin
ID: 37003815
See here: http://dev.mysql.com/doc/refman/5.0/en/secure-connections.html   Also, find "have ssl" in the Variables for that MySQL server.  If it says 'YES', then SSL is enabled and running.  If it says 'DISABLED', the server was not started with the correct options.  And if it says anything else or isn't even listed, then SSL isn't available.

Accepted Solution

Hellmark earned 2000 total points
ID: 37003827
For having an ssh tunnel, you cannot simply start an ssh connection. You have to have your SSH client connect and sit to listen, acting as a proxy, and then configure the app you want to use as connecting with a socks4 proxy.

Punch your server info into putty, then on the left hand side, select Connection, and find SSH, and under that will be Tunnels. Add port forwarding, with some random port on your machine as being where you want it to listen, then leave destination port as blank. Make sure to click on dynamic. Once done, hit open, give it your ID and password, then as mentioned before, configure your mysql client to use a socks 4 proxy via localhost on the port you set.


Featured Post

 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Hello EE, Today we will learn how to send all your network traffic through Tor which is useful to get around censorship and being tracked all together to a certain degree. This article assumes you will be using Linux, have a minimal knowledge of …
Viewers will learn how to properly install and use Secure Shell (SSH) to work on projects or homework remotely. Download Secure Shell: Follow basic installation instructions: Open Secure Shell and use "Quick Connect" to enter credentials includi…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Suggested Courses
Course of the Month17 days, 16 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question