27

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

我已经关注了这个线程:http ://ubuntuforums.org/showthread.php?t=743991这把我带到了这个线程http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=499399但是没有关于如何解决这个问题的明确指示。

谢谢!

4

5 回答 5

52

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

编辑:

for在第一个语句之前添加以下行config.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
于 2010-07-09T19:49:03.840 回答
24

在 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;
于 2012-06-14T14:49:36.747 回答
3

只需要编辑 /etc/phpmyadmin/config.inc.php 打开这个文件。查找/* Authentication type */ 添加

/*costume config add by me */
$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;

这里 AllowNoPassword 负责允许无密码登录

于 2016-09-09T11:04:44.083 回答
2

在我的情况下(Ubuntu 12.04,phpMyAdmin 4)我必须编辑相同的文件/etc/phpmyadmin/config.inc.php

我补充说:

$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'MyPassword';

/* Authentication type */

评论(关于第 107 行)

于 2013-09-09T21:27:48.170 回答
0

作为对 kachar 和 matthy 的回答的补充,如果您有phpmyadmin/config.sample.inc.phpphpmyadmin/config.inc.php请重命名示例文件。它在我的情况下解决并被检测为配置文件。

于 2016-06-11T12:16:49.807 回答