我在Debian上使用Python和Mariadb设置了Django服务器(称为D服务器)。所有人都在工作。我想使用另一个具有PHPMyAdmin的服务器(称为P服务器)来管理D服务器MariaDB。我能够配置远程访问,打开防火墙,然后从P服务器登录到D服务器,然后通过终端(MariaDB中的SSH腻子)将数据插入D服务器上的表中。然后,将以下代码添加到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';
Bingo一切正常,我得到下拉列表选择,并使用服务器P上的phpMyAdmin连接到服务器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'的访问被拒绝(使用密码:是)”
问题是如何使用phpMyAdmin用户名和密码登录表单。
答案 0 :(得分:0)
看看auth_type。
更改:
$cfg['Servers'][$i]['auth_type'] = 'config';
to
$cfg['Servers'][$i]['auth_type'] = 'cookie';
这将允许用户使用Web表单登录。