我正在使用xampp v3.2.2
,当我启动服务器Apache
时,我尝试访问localhost/phpmyadmin/
但是我收到 3 条消息:
1045 - Access denied for user 'root'@'localhost' (using password: NO)
和
mysqli_real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO)
并且phpmyadmin
尝试连接MySQL
服务器,但服务器拒绝了该连接,我应该检查主机
,
和config.inc.php
上的用户名密码
我在互联网上进行了搜索,但没有任何有用的信息。
这是配置文件代码:
/* 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'] = '';
谢谢。
最佳答案
我有相同的 xampp 版本,我的配置文件中与您上面列出的几个设置不同的唯一区别是此设置:
$cfg['Servers'][$i]['host'] = '127.0.0.1';
此外,请查看页面右侧的一些“相关”链接,因为如果存在其他问题,其中的某些信息也可能具有相关性。
关于使用 xampp 拒绝 phpMyAdmin 访问 #1045,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42892944/