【问题标题】:phpMyAdmin can't connect to remote sever on Windows 7 from Linux clientphpMyAdmin 无法从 Linux 客户端连接到 Windows 7 上的远程服务器
【发布时间】:2017-12-10 07:28:56
【问题描述】:

我无法从 Linux 机器上的 phpMyAdmin 连接到 Windows 7 上的 mysql 服务器。

我已经通过修改common.inc.php 配置了phpMyAdmin。 我在common.inc.php 的底部添加了以下几行:

$i=2;
$cfg['Servers'][$i]['host'] = 'HostName:port'; //provide hostname and port if other than default
$cfg['Servers'][$i]['user'] = 'userName';      //user name for your remote server
$cfg['Servers'][$i]['password'] = 'Password';  //password
$cfg['Servers'][$i]['auth_type'] = 'config';   // keep it as config
$i++;

我看到一个下拉菜单,其中列出了远程服务器,但是当我选择远程服务器时,phphMyAdmin 返回到本地主机,并且它没有连接到远程服务器而没有错误消息。

使用mysql命令连接远程数据库服务器,使用相同的用户/密码,就可以成功连接数据库服务器了。

版本是:

PHP 5.4.16 Development Server
phpMyAdmin 4.4.15.10
MySQL 5.6.32 - MySQL Community Server (GPL)

请求是从post发起的 Error from phmpMyAdmin when is configured in order to access remote server with local phpMyAdmin client 我在哪里输入了关于 phpMyAdmin 配置的请求

【问题讨论】:

    标签: php mysql linux windows phpmyadmin


    【解决方案1】:

    不支持在 'host' 指令中使用端口号。使用 '$cfg['Servers'][$i]['port']' 指令来指示端口号。 https://docs.phpmyadmin.net/en/latest/config.html#cfg_Servers_port

    【讨论】:

    • 我没有使用端口号,发布的设置只是一个示例。
    【解决方案2】:

    我是这样解决的: 将设置行放在 $GLOBALS['server'] = 0; 之后,变量 i 初始化为 1 ( $i=1; ),而不是将它们放在 common.inc.php 的底部。

    【讨论】:

    • 你使用了端口号吗?
    • @Marc Delisle 我没有使用端口号,发布的设置只是一个示例
    【解决方案3】:

    您可以通过在 phpmyadmin 配置文件中添加一段代码来访问远程服务器...

    $i++;
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['auth_type'] = 'config';
    $cfg['Servers'][$i]['host'] = '';
    $cfg['Servers'][$i]['user'] = '';
    $cfg['Servers'][$i]['password'] = '';
    

    试试这个

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-20
      • 2017-09-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多