首页 > 解决方案 > 连接到远程服务器时无法让 phpmyadmin 使用登录表单

问题描述

我在 Debian 上使用 Python 和 Mariadb 建立了一个 Django 服务器(称为 D-server)。所有人都在工作。我想使用另一个具有 PHPMyAdmin 的服务器(称为 P-server)来管理 D-server MariaDB。我能够配置远程访问,打开防火墙并从 P-server 登录到 D-server,并通过终端(MariaDB 中的 SSH putty)将数据插入 D-server 上的表中。然后我将以下代码添加到 PHPMyAdmin config.inc.php 文件以使用 PHPMyAdmin。

$i++;
$cfg['Servers'][$i]['host']          = '192.168.100.11';
$cfg['Servers'][$i]['port']          = '3306';
$cfg['Servers'][$i]['socket']        = '';
$cfg['Servers'][$i]['connect_type']  = 'tcp';
$cfg['Servers'][$i]['extension']     = 'mysqli';
$cfg['Servers'][$i]['compress']      = FALSE;
$cfg['Servers'][$i]['auth_type']     = 'config';
$cfg['Servers'][$i]['user']          = ‘myusername’;
$cfg['Servers'][$i]['password']      = 'mypassword';

宾果游戏一切正常,我得到下拉选择并使用 server-P 上的 phpMyAdmin 连接到我的 Server-D。

但是(问题),它会自动连接,但我无法使用 PHPMyAdmin 表单登录表单。所以我用两个单引号取出了我的用户名和密码:

$cfg['Servers'][$i]['user']          = ‘’;( that is two Single ‘’)
$cfg['Servers'][$i]['password']      = ''; ( that is two Single ‘=)

MySQL 说:文档

我无法连接无效设置:“phpMyAdmin 尝试连接 MySQL 服务器,但服务器拒绝连接。您应该检查配置中的主机、用户名和密码,并确保它们与管理员提供的信息相对应MySQL 服务器。”

然后,如果我使用两个双“”,我会得到:

“mysqli_real_connect(): (HY000/1045): 拒绝访问用户'dbadmin@192.168.100.3'@'localhost' (使用密码: YES)”

问题是如何使用 phpMyAdmin 用户名和密码登录表单。

标签: phpmyadminmariadb

解决方案


看看auth_type

改变:

$cfg['Servers'][$i]['auth_type']     = 'config';
to
$cfg['Servers'][$i]['auth_type']     = 'cookie';

这将允许用户使用网络表单登录。


推荐阅读