Configuring Homestead to work with MySQL Workbench

user3718908 picture user3718908 · Apr 16, 2015 · Viewed 7.8k times · Source

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?

Answer

Prakhar picture Prakhar · Oct 9, 2016

I was facing the same issue and I tried below steps to fix it. Please let me know if they work for you.

  1. Note the homestead ip address for your vagrant box. It is available in Homestead.yaml file under ~/.homestead directory. This directory location would be different on different OS. But since you have already installed vagrant with homestead you should know its location. For me the ip address was 192.168.10.10.
  2. Open up the Mysql Connection wizard and provide the below settings hostname = 192.168.10.10 port = 3306 username = homestead password = secret
  3. Test Your connection

For me these settings worked. Check if they work for you.