【问题标题】:phpMyAdmin Access Denied #1045 using xamppphpMyAdmin 访问被拒绝 #1045 使用 xampp
【发布时间】:2017-08-11 02:27:02
【问题描述】:

我正在使用 xampp v3.2.2,当我启动服务器 Apache 时,我尝试转到 localhost/phpmyadmin/,但我收到 3 条消息:

1045 - 用户 'root'@'localhost' 的访问被拒绝(使用密码:否)

mysqli_real_connect(): (HY000/1045): 用户 'root'@'localhost' 的访问被拒绝(使用密码:否)

phpmyadmin 试图连接MySQL 服务器并且服务器拒绝了该连接,我应该检查config.inc.php 上的hostusernamepassword

我在互联网上搜索过,但没有任何用处。

这是配置文件代码:

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

/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';

谢谢。

【问题讨论】:

  • 能把代码贴出来让大家看看吗?
  • 抱歉,什么代码?
  • 你用来连接的配置文件。
  • 更新您的原始评论,以便您提出问题。也使用代码选项。

标签: php mysql phpmyadmin access-denied


【解决方案1】:

我有相同的 xampp 版本,我的配置文件中与您上面列出的几个设置不同的唯一区别 [我没有更改,原样] 是这个设置:

$cfg['Servers'][$i]['host'] = '127.0.0.1';

此外,请参阅页面右侧的一些“相关”链接,因为如果存在其他问题,其中的一些信息也可能具有相关性。

【讨论】:

  • 是的,我曾经在 'host' 中拥有它,但我读到我应该把它放在 localhost 上,因为我遇到了同样的问题
猜你喜欢
  • 2016-04-02
  • 2012-09-24
  • 2018-08-10
  • 1970-01-01
  • 2016-01-02
  • 1970-01-01
  • 2014-05-23
  • 2015-02-12
  • 2020-07-09
相关资源
最近更新 更多