Connect to MySQL Via SSH Tunnel

Posted on 2011-10-20
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 82

    Expert Comment

    by:Dave Baldwin
    See here:   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.
    LVL 7

    Accepted Solution

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
    BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (, affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
    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…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now