【问题标题】:Setting Password for phpMyAdmin为 phpMyAdmin 设置密码
【发布时间】:2011-06-30 06:02:52
【问题描述】:

我正在使用 rhel 5 和 php 5 和 mysql 5。我的服务器已经配置好并且可以顺利运行所有应用程序。我以 root 身份访问 mysql,密码是“anitha123”。但是当我通过浏览器访问 phpmyadmin 时,它不要求输入密码。有人请告诉我如何设置它,就像提示输入用户名和密码一样。由于我对php mysql不熟悉,请告诉我如何以简单的方式做到这一点。

【问题讨论】:

  • 为了帮助管理服务器,您应该考虑在serverfault.com 上发布您的问题 - Stack Overflow 用于编程问题。

标签: php mysql phpmyadmin password-protection


【解决方案1】:

找到 phpmyadmin.conf 并将 auth type 设置为 http

/* Authentication type */  
$cfg['Servers'][$i]['auth_type'] = 'http';  

【讨论】:

    【解决方案2】:

    或者简单地你可以在phpmyadmin的配置文件中添加密码。为了这 找到 phpmyadmin 目录中的 config.inc.php 文件,然后进行这些更改

    找线 $cfg['Servers'][$i]['password'] = '';

    然后在空白字段中添加您的密码为

    $cfg['Servers'][$i]['password'] = 'anitha123';

    它总是使用相同的用户名和密码打开

    【讨论】:

      【解决方案3】:

      转到 phpmyadmin 并确保您有 3 个 root 用户才能顺利使用 mysql。如果您在“密码”列中看到“否”,请通过单击 Edit Privileges---> Change Password 选择 Password 选项并设置您的密码来设置新密码。(三个都必须设置为 Password Yes)。这样做时不要刷新你的浏览器,否则你会得到一个错误

      xampp mysql Access denied for user 'root'@'localhost' using password: YES
      

      您的用户屏幕必须是这样的。

      User name   Host        Password          Global privileges
      root      127.0.0.1         Yes     ALL PRIVILEGES      Yes     
      root      ::1               Yes     ALL PRIVILEGES      Yes     
      root      localhost         Yes     ALL PRIVILEGES      Yes
      

      当完成这个。只需使用此设置-> 在 phpmyadmin 目录中打开 config.inc.php 文件

      /* Authentication type and info */
      $cfg['Servers'][$i]['auth_type'] = 'cookie';
      $cfg['Servers'][$i]['user'] = 'root';
      $cfg['Servers'][$i]['password'] = '';
      $cfg['Servers'][$i]['extension'] = 'mysqli';
      $cfg['Servers'][$i]['AllowNoPassword'] = true;  
      $cfg['Lang'] = '';
      

      现在打开 phpmyadmin。 phpmyadmin 会要求你输入密码。如果您提供正确的密码,您将能够登录。

      【讨论】:

        猜你喜欢
        • 2016-02-17
        • 2021-09-18
        • 1970-01-01
        • 2020-08-09
        • 2013-10-20
        • 2014-12-21
        • 2019-02-04
        • 2012-07-11
        • 2013-01-20
        相关资源
        最近更新 更多