如何配置config.inc.php以在phpmyadmin中创建登录表单

问题描述:

我必须下载任何文件才能在php中创建登录表单。我问过这一百万次,但林不知道你们是否得到了这个问题。我只想要一个登录表单。在phpmyadmin中。其中您将输入您的用户名和密码。我必须创建任何php登录表单,或者当您安装wampserver时它已经包含在内。我已经在C:\ wamp \ apps \ phpmyadmin3.2.0.1中配置了config.inc.php。 下面是我不包含任何密码时的样子。我需要编辑什么?请给我一个初学者我很渴望拥有登录表单,但我没有得到任何相关答案。如何配置config.inc.php以在phpmyadmin中创建登录表单

<?php 

    /* Servers configuration */ 
    $i = 0; 

    /* Server: localhost [1] */ 
    $i++; 
    $cfg['Servers'][$i]['verbose'] = 'localhost'; 
    $cfg['Servers'][$i]['host'] = 'localhost'; 
    $cfg['Servers'][$i]['port'] = ''; 
    $cfg['Servers'][$i]['socket'] = ''; 
    $cfg['Servers'][$i]['connect_type'] = 'tcp'; 
    $cfg['Servers'][$i]['extension'] = 'mysqli'; 
    $cfg['Servers'][$i]['auth_type'] = 'config'; 
    $cfg['Servers'][$i]['user'] = 'root'; 
    $cfg['Servers'][$i]['password'] = ''; 
    $cfg['Servers'][$i]['AllowNoPassword'] = true; 

    /* End of servers configuration */ 

    $cfg['DefaultLang'] = 'en-utf-8'; 
    $cfg['ServerDefault'] = 1; 
    $cfg['UploadDir'] = ''; 
    $cfg['SaveDir'] = ''; 

    ?> 

首先,你没有发展任何形式的自己:phpMyAdmin的,这取决于它的配置(即config.inc.php会显示一个标识形式,它要求一个登录名和密码。

要获得这种形式,你不应该使用:

$cfg['Servers'][$i]['auth_type'] = 'config'; 

但是,你应该使用:

$cfg['Servers'][$i]['auth_type'] = 'cookie'; 

(至少,这就是我有一个提示登录的服务器上/密码,使用表格)


欲了解更多信息,你可以看看文件心理状态:

'config'认证($auth_type = 'config')是普通的老的方法:用户名和口令被存储在 配置。 inc.php。在2.2.3 介绍

'cookie' 认证模式($auth_type = 'cookie')允许您登录与饼干的帮助任何有效 MySQL用户。
用户名和密码在会话期间被存储在cookie中 和 密码在结束时被删除。

+0

感谢,这是我一直在寻找的答案。你是那个人! – user225269 2010-02-26 12:35:33

+0

不客气:-) – 2010-02-26 12:37:47

$cfg['Servers'][$i]['auth_type'] = 'cookie'; 

应该工作。

the manual

AUTH_TYPE = '饼干' 提示在友好的HTML形式的MySQL用户名和密码。这也是登录到任意服务器的唯一方式(如果启用了$ cfg ['AllowArbitraryServer'])。 Cookie适用于大多数安装(在pma 3.1+中默认),它提供了配置上的安全性,并允许多个用户使用相同的phpMyAdmin安装。对于IIS用户,Cookie通常比http更容易配置。

$cfg['Servers'][$i]['AllowNoPassword'] = false;