@Abid Create a new connection on your MySQL browser with homestead as your user and and a password of your choice but let the password reflect what's on your .env file
Jan 13, 2016
6
Level 11
Connect to Host Machine MySQL from inside Vagrant Box?
I'm looking for ways to connect my php projects (inside vagrant) to use host machine's MySQL connection. How can I do it?
Using Homestead if needed.
Level 8
@Abid you need to use ip 10.0.2.2 in order to connect to your host machine. This is a standard IP that get configured on homestead. if you use your machines local IP then you will need to change it each time it changes, when e.g you connect to another network!
here is my .env db detail which connects on a mysql db on my host from inside homestead vm.
DB_HOST=10.0.2.2
DB_DATABASE=laravel52
DB_USERNAME=root
DB_PASSWORD=root
13 likes
Please or to participate in this conversation.