【发布时间】:2017-11-20 11:13:33
【问题描述】:
我已经安装了 MAMP,我从来没有遇到过问题。今天我尝试登录 PHPMyAdmin 并收到以下错误消息:
1045 - 用户 'root'@'localhost' 的访问被拒绝(使用密码:YES)
在我的 config.inc.php 文件中,设置了以下选项:
$cfg['Servers'][$i]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user
$cfg['Servers'][$i]['password'] = 'root';
我从未更改过我的密码。这是本地安装,所以我一直使用“root”作为用户名和密码。
我已经尝试通过终端访问 MySQL:
/Applications/MAMP/Library/bin/mysql
但我明白了:
ERROR 1045 (28000): Access denied for user 'boneill'@'localhost' (using password: NO)
不确定会发生什么。我没有更改密码或类似的东西。它只是突然停止工作。有什么想法吗?
【问题讨论】:
-
尽量不要使用任何密码,并检查您使用的端口
-
在哪里/如何尝试?我所做的只是启动 MAMP 服务器并尝试导航到 PHPMyAdmin,但我得到了错误。
-
和端口:Apache:80,Ngnix:8888,MySQL:3306
-
$cfg['Servers'][$i]['password'] = 'root';删除此行,如果它不起作用,请检查 mamp 设置以检查您是否使用了正确的端口
-
也可以试试 127.0.0.1 而不是 localhost
标签: php mysql phpmyadmin mamp