<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="windows-and-ssh">
      </a>
      8.3.4 Connecting to MySQL Remotely from Windows with SSH
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045246499456">
  </a>
  <a class="indexterm" name="idm46045246498448">
  </a>
  <a class="indexterm" name="idm46045246496960">
  </a>
  <p>
   This section describes how to get an encrypted connection to a
      remote MySQL server with SSH. The information was provided by
      David Carlson
   <code class="email">
    &lt;
    <a class="email" href="mailto:dcarlson@mplcomm.com">
     dcarlson@mplcomm.com
    </a>
    &gt;
   </code>
   .
  </p>
  <div class="orderedlist">
   <ol class="orderedlist" type="1">
    <li class="listitem">
     <p>
      Install an SSH client on your Windows machine. For a
          comparison of SSH clients, see
      <a class="ulink" href="http://en.wikipedia.org/wiki/Comparison_of_SSH_clients" target="_blank">
       http://en.wikipedia.org/wiki/Comparison_of_SSH_clients
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      Start your Windows SSH client. Set
      <code class="literal">
       Host_Name =
       <em class="replaceable">
        <code>
         yourmysqlserver_URL_or_IP
        </code>
       </em>
      </code>
      .
          Set
      <code class="literal">
       userid=
       <em class="replaceable">
        <code>
         your_userid
        </code>
       </em>
      </code>
      to log in to your server. This
      <code class="literal">
       userid
      </code>
      value
          might not be the same as the user name of your MySQL account.
     </p>
    </li>
    <li class="listitem">
     <p>
      Set up port forwarding. Either do a remote forward (Set
      <code class="literal">
       local_port: 3306
      </code>
      ,
      <code class="literal">
       remote_host:
       <em class="replaceable">
        <code>
         yourmysqlservername_or_ip
        </code>
       </em>
      </code>
      ,
      <code class="literal">
       remote_port: 3306
      </code>
      ) or a local forward (Set
      <code class="literal">
       port: 3306
      </code>
      ,
      <code class="literal">
       host:
          localhost
      </code>
      ,
      <code class="literal">
       remote port: 3306
      </code>
      ).
     </p>
    </li>
    <li class="listitem">
     <p>
      Save everything, otherwise you must redo it the next time.
     </p>
    </li>
    <li class="listitem">
     <p>
      Log in to your server with the SSH session you just created.
     </p>
    </li>
    <li class="listitem">
     <p>
      On your Windows machine, start some ODBC application (such as
          Access).
     </p>
    </li>
    <li class="listitem">
     <p>
      Create a new file in Windows and link to MySQL using the ODBC
          driver the same way you normally do, except type in
      <code class="literal">
       localhost
      </code>
      for the MySQL host server, not
      <em class="replaceable">
       <code>
        yourmysqlservername
       </code>
      </em>
      .
     </p>
    </li>
   </ol>
  </div>
  <p>
   At this point, you should have an ODBC connection to MySQL,
      encrypted using SSH.
  </p>
 </div>
 <br/>
</div>
