简体   繁体   English

phpMyAdmin安装程序无法识别自己的密码

[英]phpMyAdmin setup does not recognize its own passwod

So, I'm trying to setup phpMyAdmin on my new server, but I cannot enter the setup because im prompted with a .htaccess password messagebox which expects a username/password. 因此,我正在尝试在新服务器上设置phpMyAdmin,但无法输入安装程序,因为im提示输入.htaccess密码消息框,要求输入用户名/密码。

The apache.conf in the /etc/phpmyadmin folder looks like this: /etc/phpmyadmin文件夹中的apache.conf如下所示:

# phpMyAdmin default Apache configuration

Alias /phpmyadmin /usr/share/phpmyadmin

   <Directory /usr/share/phpmyadmin>
    Options FollowSymLinks
    DirectoryIndex index.php

    <IfModule mod_php5.c>
        <IfModule mod_mime.c>
            AddType application/x-httpd-php .php
        </IfModule>
        <FilesMatch ".+\.php$">
            SetHandler application/x-httpd-php
        </FilesMatch>

        php_flag magic_quotes_gpc Off
        php_flag track_vars On
        php_flag register_globals Off
        php_admin_flag allow_url_fopen Off
        php_value include_path .
        php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
        php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/
    </IfModule>
</Directory>

# Authorize for setup
<Directory /usr/share/phpmyadmin/setup>
    <IfModule mod_authz_core.c>
        <IfModule mod_authn_file.c>
           AuthType Basic
           AuthName "phpMyAdmin Setup"
           AuthUserFile /etc/phpmyadmin/htpasswd.setup
        </IfModule>
        Require valid-user
    </IfModule>
</Directory>

I have already checked the htpasswd.setup file, which says: 我已经检查了htpasswd.setup文件,该文件显示:

admin:*

However, when I enter admin and leave the password field blank, the server rejects me. 但是,当我输入admin并将密码字段保留为空白时,服务器拒绝我。 The apache2 error.log says: apache2 error.log说:

[Fri Mar 04 12:07:05.812975 2016] [auth_basic:error] [pid 3449] [client 95.112.247.64:50581] AH01617: user admin: authentication failure for "/phpmyadmin/setup": Password Mismatch

Did I do anything wrong previously? 我以前做错什么了吗? Because this does not make sense to me at all. 因为这对我完全没有意义。

You appear to have installed phpMyAdmin from your distribution's packaged version, so something went wrong on installation. 您似乎从发行版的打包版本中安装了phpMyAdmin,因此安装时出现了问题。 As Lelio Faieta indicated, this isn't directly from phpMyAdmin, it's a protection your package maintainer has implemented, so you probably should seek support directly from your distribution. 正如Lelio Faieta指出的那样,这不是直接来自phpMyAdmin,这是您的软件包维护者已实现的保护,因此您可能应该直接从发行版中寻求支持。

First try reinstalling/reconfiguring. 首先尝试重新安装/重新配置。

With Debian/Ubuntu: dpkg-reconfigure --plow phpmyadmin CentOS doesn't seem to have a reconfigure option. 使用Debian / Ubuntu: dpkg-reconfigure --plow phpmyadmin CentOS似乎没有重新配置选项。

If that fails, I don't anticipate any reason you couldn't just reset the password. 如果失败,我认为您无法重设密码的任何原因。 Unlike, for instance, the control user or the system database user, the username/password isn't (likely to be) used anywhere else so you can (should be able to safely) change the password: 与控制用户或系统数据库用户不同,用户名/密码不会(可能)在其他任何地方使用,因此您可以(应该能够安全地)更改密码:

sudo htpasswd /etc/phpmyadmin/htpasswd.setup admin

Or even better, I'd personally add a new account and forget about 'admin': 甚至更好的是,我个人添加了一个新帐户,而忘记了“ admin”:

sudo htpasswd /etc/phpmyadmin/htpasswd.setup yunowork

Although technically this might leave you vulnerable if someone else knows the admin password, but I imagine your distribution generated a password, plus running the setup script is not the same as having database access anyway. 虽然从技术上讲,如果其他人知道管理员密码,这可能会使您容易受到攻击,但是我想您的发行版生成了密码,而且运行安装脚本与拥有数据库访问权限完全不同。 So you're extremely likely to be fine either way. 因此,无论哪种方式,您极有可能都很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM