title: MySQL Server Refusing Local Connections Over SSH Tunnel
body: <p>I have a remote Windows server with MySQL and Cygwin (enabling remote SSH connections). When I connect from a local instance of Workbench (i.e. with Workbench handling the tunnel), via SSH as root, I have no problem connecting to the remote database.</p>
  
  <p>I have a need to set up my own tunnel because I have another app that needs MySQL access. I chose to use Putty, and had only partial success.</p>
  
  <p>I can connect (using Workbench as a test client) through my tunnel, localhost:3307, which I have forwarded to myremoteserver.no-ip.com:3306, ONLY if I have the remote root user there set to accept connections from all hosts (%), AND/OR the actual IP of the server.</p>
  
  <p>If I restrict root to 127.0.0.1 (as it should be) I get the error <code>Host x.x.x.x is not allowed to connect to this MySQL server</code> where x.x.x.x is the actual address of the remote server!</p>
  
  <p>Somehow, using Putty to make the tunnel isn't presenting me as a local connection. But instead as a remote connection, even though the remote IP is the IP of the remote server</p>
  
  <p>My Question: How can I set up putty to mimic the way Workbench successfully makes tunnel connections?</p>
  
  <p>Note: All my connections to the remote IP are via a no-ip address. This works when Workbench opens the tunnel. Also my server is run within the AWS EC2 ecosystem.</p>
  
  <p>My current Putty connection is to the no-ip address and tunneling settings are <code>Source:3307, Destination: myremoteserver.no-ip.com:3306, Local and Auto</code>.</p>
  
  <p><strong>Edit: I have also tried <code>127.0.0.1:3306</code> as the destination address in the Putty tunnel settings and got the same result.</strong></p>