【问题标题】:Access Denied while accessing http://localhost/phpmyadmin/ page访问 http://localhost/phpmyadmin/ 页面时访问被拒绝
【发布时间】:2016-03-14 11:37:39
【问题描述】:

我在 opensuse13.2 中安装了 xampp。它安装得很整齐。但是在访问http://localhost/phpmyadmin/ 页面时出现以下错误。我在这里尝试了几个答案,但没有任何帮助,例如将密码设置为“”或“”。尝试通过“http”而不是“config”进行身份验证。但没有一个有效。

MySQL 说:文档

无法连接:无效设置。 配置中定义的 controluser 连接失败。 phpMyAdmin 尝试连接 MySQL 服务器,但服务器拒绝连接。您应该检查配置中的主机、用户名和密码,并确保它们与 MySQL 服务器管理员提供的信息相对应。

下面是 phpmyadmin/config.inc.php 文件的内容。

/**
 * Servers configuration
 */
$i = 0;

/**
 * First server
 */
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = 'root';
/* Server parameters */
//$cfg['Servers'][$i]['host'] = 'localhost';
//$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;

/**
 * phpMyAdmin configuration storage settings.
 */

/* User used to manipulate with storage */
// $cfg['Servers'][$i]['controlhost'] = '';
// $cfg['Servers'][$i]['controlport'] = '';
$cfg['Servers'][$i]['controluser'] = 'root';
$cfg['Servers'][$i]['controlpass'] = 'root';

/* Storage database and tables */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';

【问题讨论】:

    标签: php mysql phpmyadmin xampp


    【解决方案1】:

    将此行改为

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

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

    尝试无密码登录

    也改变这一行

    $cfg['Servers'][$i]['controluser'] = 'root';
    $cfg['Servers'][$i]['controlpass'] = 'root';
    

    $cfg['Servers'][$i]['controluser'] = '';
    $cfg['Servers'][$i]['controlpass'] = '';
    

    update:修改行后重启。您的代码中有以下行,它允许用户在没有密码的情况下登录,上面的代码在删除密码后有效

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

    【讨论】:

      【解决方案2】:

      我建议尝试将密码和 controlpass 设置为 ''; 而不是 'root';

      附:发布您迄今为止尝试过的内容可能会有所帮助。这样我们就不会重复可能的解决方案。

      附言我无法发表评论,并且添加另一个答案似乎不合适,所以我会简单地编辑这个。

      也许你可以设置端口?标准的是 80,但有时其他程序(例如 Skype)也会使用它。所以你可能想使用 8080。但是你应该将 localhost 更改为 localhost:8080。

      P.P.P.S.也许您已经发现了这一点,但这里有一些链接可能会提供有用的信息: http://www.prestadocumentation.com/how-to-install-phpmyadmin/ http://wpquestions.com/question/showChrono/id/8374

      【讨论】:

      • 我试过了,没用。此外,我得到“配置中定义的 controluser 连接失败。”错误也是如此。好的,我会更新我尝试的所有内容。
      猜你喜欢
      • 2016-09-24
      • 2014-05-25
      • 1970-01-01
      • 1970-01-01
      • 2016-04-02
      • 2014-12-22
      • 2012-07-26
      • 2013-08-28
      相关资源
      最近更新 更多