I recently installed VM and Vagrant to work with my Laravel projects. So I'm new to this. I dont have MySQL installed on my main machine. I tried to Vagrant up and then ssh [email protected] -p 2222. Everything is fine and dandy uptil this point. I want to access MySQL and cant get access. This is what ive done:
mysql -u root -p (password "") -h localhost
mysql -u root -p (password "root") -h localhost
mysql -u root -h localhost
And even all of those without -h localhost. I havent set up MySQL before so keep in mind, ive never made an account to even access MySQL.
Ive searched around and ive found this:
Go to:
sudo vi /etc/mysql/my.cnf
And comment out: skip-external-locking and change this: bind-address: 0.0.0.0.
I then went back and restarted MySQL using sudo service mysql restart and tried those commands again...still no access.
Btw the error im getting is: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
However, there was something that i found interesting...
I went to cd /etc/mysql and I found a file named: debian.cnf and it had a username and password and i tried that username and password and i was logged in!!! but i dont think i was supposed to do it that way. and that password provided by that file is probably a hash of something.
Im stuck. I dont know what to do from here!
Update
I forgot to add: If i just provide mysql, I get this error ERROR 1045 (28000): Access denied for user 'vagrant'@'localhost' (using password: NO)