title: Phpmyadmin over ssh tunnel
body: <p>I've got an interesting issue here, But basically my setup is:</p>
  
  <p>I have a windows PC that runs a MySql server. it is on Cellular. it will eventually replicate the DB to a remote server. It connects to said remote server via SSH tunnels.</p>
  
  <p>Remote server runs centos, MySql, phpMyAdmin, and receives ssh tunnels.</p>
  
  <p><strong>What I can do:</strong>
  Connect through tunnel to the Windows PC MySql server via MySql COMMAND LINE on the Centos server.</p>
  
  <p><strong>What I cant do:</strong> 
  Connect through the tunnel to the Windows PC MySql server via PhpMyAdmin (which is running on the centos box).</p>
  
  <p>The error I am getting on phpmyadmin:</p>
  
  <pre><code>MySQL said: Documentation
  
  Cannot connect: invalid settings. 
   phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
  </code></pre>
  
  <p>Phpmyadmin config snipet:</p>
  
  <pre><code>    $i++;
  $cfg['Servers'][$i]['auth_type']     = 'config';
  $cfg['Servers'][$i]['username']      = 'root';
  $cfg['Servers'][$i]['password']      = 'asdf';
  //$cfg['Servers'][$i]['verbose'] = 'dev-slate';
  $cfg['Servers'][$i]['host']          = '127.0.0.1';
  $cfg['Servers'][$i]['port']          = '23800';
  //$cfg['Servers'][$i]['socket']        = '';
  $cfg['Servers'][$i]['connect_type']  = 'tcp';
  $cfg['Servers'][$i]['extension']     = 'mysqli';
  //$cfg['Servers'][$i]['compress']      = FALSE;
  </code></pre>
  
  <p>Tunnel command run from the windows PC:</p>
  
  <pre><code>plink centos-server-ip -P 22 -l user -pw pass -R 23800:127.0.0.1:23800
  </code></pre>
  
  <p>Port of windows mysql is 23800.</p>
  
  <p>Mysql connect command that worked:</p>
  
  <pre><code>mysql -u root -p -h 127.0.0.1 -P 23800
  </code></pre>
  
  <p>Any idea what gives?</p>
  
  <p>Sorry if I left anything important out, I tried explaining as much as I think is useful.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>in the real world I will not know the IP of the Windows Mysql server, but I do now in testing.</p>
  
  <p>I created a user on the windows mysql database with the Centos IP as allowed host, and successfully logged into the Windows Mysql from the Centos command line, using the IP address.</p>
  
  <p>I then added the IP address to phpMyAdmin script, in place of 127.0.0.1.
  And it still is a no go, same result, tested with either cookie or config authentication.</p>
  
  <p>I have looked on Google, and toms of people have gotten this EXACT method to work this exact way. How is it possible, I can not see how it is going wrong.</p>