天天看点

Mysql:通过SSH隧道方式实现安全通讯

6.3.4 Connecting to MySQL Remotely from Windows with SSH

This section describes how to get an encrypted connection to a remote MySQL server with SSH. The information was provided by David Carlson

<[email protected]>

.

  1. Install an SSH client on your Windows machine. For a comparison of SSH clients, see http://en.wikipedia.org/wiki/Comparison_of_SSH_clients.
  2. Start your Windows SSH client. Set

    Host_Name =

    yourmysqlserver_URL_or_IP

    . Set

    userid=

    your_userid

    to log in to your server. This

    userid

    value might not be the same as the user name of your MySQL account.
  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 will have to redo it the next time.
  5. Log in to your server with the SSH session you just created.