【发布时间】:2015-11-12 07:28:04
【问题描述】:
我最近将 MySQL 中 root 用户的密码重置为空白值。我在 config.inc.php 文件中验证了这种情况:
$cfg['Servers'][$i]['user'] = 'root'; // MySQL user
$cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed
// with 'config' auth_type)
但是,每次我重新启动 MAMP 服务器时,都会弹出此错误:
检查 MySQL 数据库失败
错误信息:
/Applications/MAMP/Library/bin/mysqlcheck:得到错误:1045:访问 尝试时拒绝用户'root'@'localhost'(使用密码:YES) 连接
但是,我仍然可以通过 MySQLWorkBench 完美地连接到我的 MySQL 数据库。只是每次都会弹出这个愚蠢的错误,即使我没有设置密码。为什么这种情况不断发生?
我已经尝试了从重新启动 MAMP 到从命令行 (the solution in the MAMP docs) 重置密码的所有方法,但均无济于事。我还尝试执行以下操作:
$ /Applications/MAMP/Library/bin/mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
...
mysql>
这样我就可以通过终端成功连接MySQL了。这是否意味着问题出在我的 phpMyAdmin 配置中?
【问题讨论】: