【发布时间】: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 上的host、username 和password
我在互联网上搜索过,但没有任何用处。
这是配置文件代码:
/* 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