Search the MySQL manual:

2.6.1.4 Connecting to MySQL Remotely from Windows with SSH

Here is a note about how to connect to get a secure connection to remote MySQL server with SSH (by David Carlson dcarlson@mplcomm.com):

  1. Install an SSH client on your Windows machine. As a user, the best non-free one I've found is from SecureCRT from http://www.vandyke.com/. Another option is f-secure from http://www.f-secure.com/. You can also find some free ones on Google at http://directory.google.com/Top/Computers/Security/Products_and_Tools/Cryptography/SSH/Clients/Windows/.
  2. Start your Windows SSH client. Set Host_Name = yourmysqlserver_URL_or_IP. Set userid=your_userid to log in to your server (probably not the same as your MySQL login/password.
  3. Set up port forwarding. Either do a remote forward (Set local_port: 3306, remote_host: yourmysqlservername_or_ip, remote_port: 3306 ) or a local forward (Set port: 3306, host: localhost, remote port: 3306).
  4. Save everything, otherwise you'll have to redo it the next time.
  5. Log in to your server with SSH session you just created.
  6. On your Windows machine, start some ODBC application (such as Access).
  7. Create a new file in Windows and link to MySQL using the ODBC driver the same way you normally do, except type in localhost for the MySQL host server--not yourmysqlservername.

You should now have an ODBC connection to MySQL, encrypted using SSH.

User Comments

Posted by John Hardin on Thursday March 27 2003, @1:07pm[Delete] [Edit]

There is a Windows port-forwarding-only (no terminal emulation capabilities) SSH client available at:

http://www.fuji-climb.org/pf/

It's a nice lightweight solution for remote database access.

Posted by Joachim Baert on Wednesday April 9 2003, @3:04am[Delete] [Edit]

I frequently use the small and freeware PuTTY client with lots of options, and which has also a command-line version 'Plink', suitable for scripting.

See: http://www.chiark.greenend.org.uk/~sgtatham/putty/

Joachim.

Posted by Manuel Razzari on Monday June 30 2003, @11:39pm[Delete] [Edit]

Manage mysql via SSH from your windows machine with MySQLcc

You need: and .
MySQLcc: http://www.mysql.com/downloads/mysqlcc.html
Putty: http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe
And a hosting provider with SSH enabled!

Open putty.exe.

Specify the host name or IP of your site. Click on the "SSH" radio button.

Go to the settings Connection > SSH > Tunneling

Add new forwarded port:
Source port: 3306
Destination: localhost:3306
Click on the "Local" radio button.
Click "Add"

Go back to Session settings, type a name for Saved session and click "Save". Then click "Open"

You will be asked for login and password. Enter them.

On MySQLControlCenter, go to File > New, type a Name for your connection. Then at host name type
localhost
Then your user name and password in the following fields.

Click "Add", then double click on the new server icon to connect!

Add your own comment.