I was following a Ruby on Rails tutorial (fairly new to this language) and suddenly started having some problems connecting with MySQL on my Mac. While doing the tutorial I believe I changed the shell location using similar steps in this guide, not sure if that’s important at all.
My $PATH
returns:
-bash: /Users/[MYUSERNAME]/.rbenv/shims:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin://usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin: No such file or directory
Anyway, I’ve been working through the tutorial and have been developing since then but I went to check my files a week or so later and suddenly cannot connect to MySQL at all, if I enter mysql -u root -p
(then enter correct password as it always has been) I get:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
I’ve got MySQL Workbench although I rarely use it, and I use the System Preferences App to start and stop my server. I also have MAMP which I was using a while ago but I haven’t used it since using RoR.
Strange thing is, this happened before and I couldn’t connect, I was searching around for ages trying to find a solution and (not sure what I did, probably nothing substantial) it started working again. But once again it’s happened and think it’s time I learnt what the problem is so I don’t keep running into it.
Personally, I think I should’ve learnt MySQL in more depth before blind-following a tutorial assuming it’d be fine.
Any help would be greatly appreciated, thanks!
Let me know if you need me to provide anything else.