php phpMyAdmin 禁用管理员登录

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3216009/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 09:02:13  来源:igfitidea点击:

phpMyAdmin disable admin login

phpmysqlphpmyadminautologin

提问by Yanick Rochon

I have Ubuntu, and installed the phpMyAdmin package (currently 4:3.3.2-1). Every 30 minutes, it asks me to enter my username and password, for inactive session timeout. In earlier version of phpMyAdmin, setting a user/pass would entirely skip this login form and keep the session open indefinitely. This installation is on a dev machine (single user on closed private network) and I want to disable, or bypass that login form so I never have to actually input the user/pass again. I tried fiddling with the configuration files (there are like 3, not even sure which one is used) but nothing seems to change.

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

I've followed this thread : http://ubuntuforums.org/showthread.php?t=743991which brought me to this thread http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=499399but there is no clear directive on how this be be solved.

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

Thanks!

谢谢!

回答by Svisstack

Open config.inc.phpon my debian instalation i can find it at /usr/share/phpmyadmin/config.inc.php. Change auth_typeand add in the first element on the array like this $cfg['Servers'][1]any data (like a host in $cfg['Servers'][1]['host']) need to auth.

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

EDIT:

编辑:

Add this lines before first forstatement in config.inc.php:

在第一个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

回答by kachar

On Ubuntu installation the config file is located at /etc/phpmyadmin/config.inc.php

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

Add/Correct these lines to the file:

将这些行添加/更正到文件中:

$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;

回答by jmarceli

In my case (Ubuntu 12.04, phpMyAdmin 4) I must edit same file /etc/phpmyadmin/config.inc.php

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

And I add:

我补充说:

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

AFTER

/* Authentication type */

comment (about line 107)

评论(关于第 107 行)

回答by Abhinav bhardwaj

Just need to edit /etc/phpmyadmin/config.inc.php Open this file. find /* Authentication type */add

只需要编辑 /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;

here AllowNoPassword is responsible for allowing login without password

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

回答by crx4

As an addition to kachar and matthy's answer if you have have phpmyadmin/config.sample.inc.phpinstead of phpmyadmin/config.inc.phpplease rename the sample file. It solves in my case and detected as config file.

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