PHPMyAdmin中的自动身份验证

时间:2010-03-23 11:54:37

标签: php authentication phpmyadmin

我有一个本地phpMyAdmin(通过apt-get安装)adn我每次尝试打开它时都厌倦了输入登录名和密码。数据库不包含敏感信息,只包含测试表,并且仅在127.0.0.1

中可见

我希望phpMyAdmin在我打开它时已经以root用户身份登录,密码为1234(例如)。我该怎么做?

P.S。在浏览器中保存密码不是我想要的。

SOLUTION:

    $cfg['Servers'][$i]['user']          = 'root';
    $cfg['Servers'][$i]['password']      = '1234'; // use here your password
    $cfg['Servers'][$i]['auth_type']     = 'config';

2 个答案:

答案 0 :(得分:1)

你应该不那么懒,从查看文档开始,因为它们都有详细描述。

http://www.phpmyadmin.net/documentation/Documentation.html#config

基本上,你将auth_type设置为config,并为其提供正确的用户和密码。

答案 1 :(得分:0)

在config.inc.php中,您还可以在94行附近找到这些行,您可以在其中取消注释该行:

function Costs(){
    this.totalPerYear = undefined;
    this.totalEver = undefined;

    this.perMonth = {
        items: {
            depreciation: undefined,
            insurance: undefined,
            credit: undefined,
            inspection: undefined,
            roadTaxes: undefined,
            fuel: undefined,
            maintenance: undefined,
            repairsImprovements: undefined,
            parking: undefined,
            tolls: undefined,
            fines: undefined,
            washing: undefined                        
        },
        standingCosts: undefined,
        runningCosts: undefined,
        total: undefined
    };

    this.perUnitDistance = { 
        runningCosts: undefined,
        totalCosts: undefined
    };
};

var userCosts = new Costs();

这比更改文件中的/* Uncomment the following to enable logging in to passwordless accounts, * after taking note of the associated security risks. */ $cfg['Servers'][$i]['AllowNoPassword'] = TRUE; 并设置用户名和密码容易。