I recently installed VM and Vagrant to work with my Laravel projects. Therefore, I am new to this. I do not have MySQL on my main machine. I tried Vagrant up and then ssh vagrant@127.0.0.1 -p 2222 . Everything is in order, and the dandy raised this moment. I want to access MySQL and not access. This is what has been done:
mysql -u root -p (password "") -h localhost mysql -u root -p (password "root") -h localhost mysql -u root -h localhost
And even everything without -h localhost . I have not configured MySQL before, so keep in mind ive never made an account even to access MySQL.
I searched around and I found this:
Switch to:
sudo vi /etc/mysql/my.cnf
And comment out: skip-external-locking and change this: bind-address: 0.0.0.0 .
Then I came back and restarted MySQL with sudo service mysql restart and tried these commands again ... still no access.
Btw error im get: 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 logged in !!! but I donβt think I should have done it that way. and this password provided by this file is probably a hash of something.
I am stuck. I do not know what to do next!
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)
source share