I installed mysql on my mac (after never having it installed on this machine previously) using brew install mysql. After the installation, I received this:
To connect:
mysql -uroot
........
Or, if you don't want/need launchctl, you can just run:
mysql.server start
Great, it worked. So I ran
kroe761$ mysql.server start
Starting MySQL
SUCCESS!
kroe761$ mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
Wait, what? I never gave mysql a password to begin with. I tried using the sudo password, which didn't work (as expected). I also tried using -p but then just hitting enter, with no password, but that did not work either. So, how do I access mysql?
Edit: I also tried this, which also did not work.
kroe761$ mysql.server start -skip-grant-tables
Starting MySQL
SUCCESS!
kroe761$ mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)