第一次安装MAMP &以前没有安装过 Mysql - 错误 1045 (28000): 用户“root”@“localhost”访问被拒绝; (使用密码:否)
请注意,我正在使用 MAMP 和 Windows 10。
我已经在堆栈溢出中搜索了几个小时,试图找到解决方案,但似乎没有通过 mamp 解决相同的问题,并且修复似乎是为了安装并运行 mysql另一种方式。
我对后端编码很陌生,所以如果我错过了一些基本的东西,请原谅我的无知。
登录时不会让我进入
mysql -u root -p
据我了解,尽管我从未设置过密码,但 mysql 已决定以某种方式随机设置一个密码,并且当我尝试使用或
mysql -u root
据我所知,对于 root 用户来说,密码应该是一个空白字符串。
相反,我
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
在没有 -p 标志的情况下登录时,以及
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
在尝试使用 -p 标志登录时得到。
我相信重置 root 密码可能会解决此问题,但我找不到有关如何使用 MAMP 执行此操作的指南,并且我在尝试使用不同的安装来解决该过程时迷失了方向。
任何帮助将不胜感激。
我尝试完全删除MAMP,包括所有数据库等,完全擦除,重新安装也有同样的问题。
Please note, I am using MAMP and Windows 10.
I've scoured stack overflow for hours trying to find a solution to this, but nothing seems to be for the same issue via mamp, and the fixes appear to be to mysql installed and run a different way.
I'm newish to coding with a back end, so please forgive my ignorance if I've missed something basic.
From what I understand, somehow mysql has decided to farbricate a random password despite me never setting one, and wont let me in when I try and log in with either
mysql -u root -p
or
mysql -u root
As I understand it, the password should be a blank string for the root user.
Instead I get
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Whilst logging in without the -p flag, and
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
When attempting to log in with it.
I believe resetting the root password may fix this, but I can't find a guide on how to do this with MAMP and I get lost trying to work out the process with different installs.
Any help would be greatly appreciated.
I've tried deleting MAMP entirely, including all databases etc, complete wipe, and the reinstall has the same issue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
原来我是个傻子,密码不为空。在 MAMP 上,密码与用户名 (root) 相同
Turns out I'm stupid, and the password isn't blank. On MAMP the password is the same as the username (root)