phpMyAdmin 禁用管理员登录

2022-08-30 15:52:38

我有Ubuntu,并安装了phpMyAdmin软件包(目前为4:3.3.2-1)。每30分钟,它会要求我输入我的用户名和密码,以用于非活动会话超时。在早期版本的phpMyAdmin中,设置user/pass将完全跳过此登录表单并保持会话无限期打开。此安装位于开发计算机上(封闭专用网络上的单个用户),我想禁用或绕过该登录表单,这样我就不必再次实际输入user/pass。我尝试摆弄配置文件(有3个,甚至不确定使用哪一个),但似乎没有什么变化。

我关注了这个帖子:http://ubuntuforums.org/showthread.php?t=743991,这使我 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=499399,但没有关于如何解决这个问题的明确指令。

谢谢!


答案 1

打开我的 debian 安装,我可以在 .更改并添加数组上的第一个元素,就像这样,任何数据(如 中的主机)都需要进行身份验证。config.inc.php/usr/share/phpmyadmin/config.inc.phpauth_type$cfg['Servers'][1]$cfg['Servers'][1]['host']

编辑:

在 中的第一个语句之前添加此行:forconfig.inc.php

$cfg['Servers'][1]['auth_type'] = 'config';
$cfg['Servers'][1]['host'] = 'localhost'; //edit if you have db in the other host
$cfg['Servers'][1]['connect_type'] = 'tcp';
$cfg['Servers'][1]['compress'] = false;
$cfg['Servers'][1]['extension'] = 'mysql';
$cfg['Servers'][1]['user'] = 'root'; //edit this line
$cfg['Servers'][1]['password'] = ''; // edit this line

答案 2

在 Ubuntu 安装中,配置文件位于/etc/phpmyadmin/config.inc.php

将以下行添加/更正到文件中:

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
$cfg['Servers'][$i]['AllowRoot'] = TRUE;

推荐