I just started using Homestead today and so far I don't think I know what I am doing, previously I was using the inbuilt PHP server that comes with Laravel and I had MySQL server and workbench installed separately on my computer.
With this setup I was able to connect to my database with ease, however since I got my Homestead running I can't seem to access that database again. This error keeps popping up:
3/3 ErrorException in Connector.php line 47: SQLSTATE[HY000] [1045]
Access denied for user 'myproject_db101'@'localhost' (using password: YES)
(View: /home/vagrant/Projects/myproject/resources/views/layout/index.blade.php)
(View: /home/vagrant/Projects/myproject/resources/views/layout/index.blade.php)
How can I fix this?
I was facing the same issue and I tried below steps to fix it. Please let me know if they work for you.
hostname = 192.168.10.10
port = 3306
username = homestead
password = secret
For me these settings worked. Check if they work for you.
These other answers might have worked for you guys, but in case anyone has a case like mine, I'm just going to provide what worked for me. Hopefully it helps someone out. I'm working on a brand new homestead installation as of today, but on a very old mac in case thats relevant.
What worked for me was using the regular localhost ip of my machine as the host, and then the homested/secret combination for the password, and using the default port but with a 0 at the end. This adds up to be the following settings:
Connection method: Standard (TCP/IP)
Host: 127.0.0.1
Username: homestead
Password: secret
Port: 33060
Hopefully this helps someone out. Its the only configuration that worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With