Phpmyadmin超过ssh隧道

时间:2017-02-10 00:59:27

标签: mysql phpmyadmin

我在这里遇到了一个有趣的问题,但基本上我的设置是:

我有一台运行MySql服务器的Windows PC。它在Cellular上。它最终会将数据库复制到远程服务器。它通过SSH隧道连接到所述远程服务器。

远程服务器运行centos,MySql,phpMyAdmin,并接收ssh隧道。

我能做什么: 通过Centos服务器上的MySql COMMAND LINE通过隧道连接到Windows PC MySql服务器。

我不能做什么: 通过隧道连接到Windows PC MySql服务器,通过PhpMyAdmin(在centos框上运行)。

我在phpmyadmin上遇到的错误:

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.

Phpmyadmin config snipet:

    $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;

从Windows PC运行隧道命令:

plink centos-server-ip -P 22 -l user -pw pass -R 23800:127.0.0.1:23800

windows mysql的端口是23800。

有效的Mysql connect命令:

mysql -u root -p -h 127.0.0.1 -P 23800

知道是什么给出了什么?

很抱歉,如果我遗漏了任何重要内容,我会尝试尽可能多地解释。

修改

在现实世界中,我不会知道Windows Mysql服务器的IP,但我现在正在测试。

我在Windows mysql数据库上创建了一个用户,Centos IP作为允许的主机,并使用IP地址从Centos命令行成功登录到Windows Mysql。

然后我将IP地址添加到phpMyAdmin脚本,代替127.0.0.1。 它仍然是一个不行,同样的结果,使用cookie或配置身份验证进行测试。

我已经看过谷歌了,而且有些人已经得到了这种确切的方法。怎么可能,我看不出它是怎么回事。

0 个答案:

没有答案