dongzao3923 2017-06-17 23:01
浏览 220

MAMP和PHPMyAdmin:#1045 - 用户'root'@'localhost'拒绝访问(使用密码:YES)[复制]

I have MAMP installed and I've never had a problem with it. Today I tried logging in to PHPMyAdmin and I got the following error message:

1045 - Access denied for user 'root'@'localhost' (using password: YES)

enter image description here

In my config.inc.php file, the following options are set:

$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';

I've never changed my password. This is a local install, so I've always used 'root' for username and password.

I've tried accessing MySQL through the terminal:

/Applications/MAMP/Library/bin/mysql

But I get this:

ERROR 1045 (28000): Access denied for user 'boneill'@'localhost' (using password: NO)

Not sure what could have happened. I haven't changed passwords or anything like that. It just stopped working all of a sudden. Any ideas?

</div>
  • 写回答

4条回答 默认 最新

  • doupijin0397 2017-06-26 21:15
    关注

    Taking into consideration that you seem to have trouble debugging the issue, I think the most easiest way to rule out some of the probabilities is to install:

    MySQL Workbench

    It's free and you can use it as a GUI to try logging in to "localhost" or better "127.0.0.1" port 3306, user "root", password as you've chosen.

    If you still notice an error connecting to the database, go to control panel -> services and check the status of the MySQL database. It might have crashed. Try to restart the service. If it shuts down again immediately, check your disk space. If you are running low on disk space, tables might have got corrupted. Also, check your firewall rules. If you are working in a corporate environment, somebody may have deployed new security polices - this might lead to port blocking, application networking issues etc. pp. -- even on your local host. Automatic windows updates might cause those changes too.


    If it works using MySQL workbench, you can rule out any issue on database side. You can focus on PHP / MAMP then. Check the version and if any update has been installed (probably automatically). Is php mysql module installed and configured (php.ini, ensure php mysql dll is loaded).

    评论

报告相同问题?

悬赏问题

  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用
  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?