I’m trying to connect to a remote host(CentOS) mysql database from localhost(CentOS) with phpmyadmin via ssh.
In local config.inc.php I added:
$i++;
$cfg['Servers'][$i]['host'] = '127.0.0.1';
$cfg['Servers'][$i]['port'] = '3307';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['auth_type'] = 'http';
$cfg['Servers'][$i]['AllowNoPassword'] = FALSE;
Next I established the tunnel ssh -Ng -L 3307:127.0.0.1:3306 root@xx.xx.xx.xx
It works fine through the command line:
mysql -P 3307 -h localhost -u root -p dbname
But when I try to access http://localhost:3307/phpmyadmin/
It says some gibberish: “5.5.20 J���
5.5.20�p��#p-.<‘J}�ÿ÷�€����������[0{=^@fa2tq^�mysql_native_password�!��ÿ„#08S01Got packets out of order”
This is because there is no web server running on port
3307. You need to access the correct URL for phpmyadmin, which is probablyhttp://localhost/phpmyadmin/and from there, select the correct server to connect to.