自动登录phpMyAdmin

| 我们要在phpMyAdmin中自动登录用户。现在我们有了一个用PHP编写的Web界面。用户可以登录。登录后,他们可以在打开phpMyAdmin的菜单中单击“ 0”链接。有没有办法自动登录?是否可以为phpMyAdmin设置cookie或让它们使用它的东西? 我们不想关闭phpMyAdmin的登录;每个用户都有自己的MySQL用户/密码组合。因此,我们需要将用户名/密码设置传递给phpMyAdmin。     
已邀请:
您可以简单地在名为ѭ1named的字段中输入用户名,并在
pma_password
的字段中输入密码。或者,如果您使用的是http身份验证模式,则可以使用用户名和密码(例如
http://user:pass@www.host.com/phpmyadmin/...
)创建链接     
在/ *身份验证类型* /下的config.inc.php中添加代码。它存在于根文件夹中
$cfg[\'Servers\'][$i][\'auth_type\'] = \'config\';
$cfg[\'Servers\'][$i][\'user\'] = \'root\';
$cfg[\'Servers\'][$i][\'password\'] = \'\'; 
    
编辑config.inc.php 位置:/etc/phpmyadmin/config.inc.php 查找打击代码
$cfg[\'Servers\'][$i][\'auth_type\'] = \'cookie\';
并用打击代码替换代码行
$cfg[\'Servers\'][$i][\'auth_type\'] = \'config\';
$cfg[\'Servers\'][$i][\'username\'] = \'root\';
$cfg[\'Servers\'][$i][\'password\'] = \'your_password\';
如果您的密码为null或\'\',则取消注释
//$cfg[\'Servers\'][$i][\'AllowNoPassword\'] = TRUE;
$cfg[\'Servers\'][$i][\'AllowNoPassword\'] = TRUE;
那就可以了!     
config.inc.php
    /* Authentication type */

if ($_SERVER[\"REMOTE_ADDR\"] == \'::1\') {
    $cfg[\'Servers\'][$i][\'auth_type\'] = \'config\';
    $cfg[\'Servers\'][$i][\'user\'] = \'user\';
    $cfg[\'Servers\'][$i][\'password\'] = \'password\';
} else {
    $cfg[\'Servers\'][$i][\'auth_type\'] = \'cookie\';
}
$ _SERVER [\“ REMOTE_ADDR \”] == \':: 1 \'(ipv6)$ _ SERVER [\“ REMOTE_ADDR \”] == \'127.0.0.1 \'(ipv4)     
有时,在本地环境中工作时,每次都会烦人登录。 为了避免这种情况,您可以执行以下操作: 在文件底部添加以下行:   phpmyadmin \\ config.inc.php
$cfg[\'LoginCookieValidity\'] = 10000; // Keep long validity :)-
$cfg[\'Servers\'][$i][\'user\']          = \'root\'; // Your user name
$cfg[\'Servers\'][$i][\'password\']      = \'root\'; // Your password
$cfg[\'Servers\'][$i][\'auth_type\']     = \'config\';
之后,关闭您的数据库服务器并重新启动。 现在检查&,您将看到无需输入用户名和密码即可登录。     

要回复问题请先登录注册