Hi guys. When I want to connect to database. I have the following error. Can't connect to MySQL server on '127.0.0.1' (4) on sequel pro. I re-install all (vagrant,homesteadt). How can I fix it?
Mysql is running on a virtual machine and you are trying to connect to your local machine. Change 127.0.0.1 (Local machine) to your vagrant installations ip. Then it should work.
Homestad is running on a virtual machine and if you want to connect to the mysql server running on it from you local machine you need to specify the virtual machines ip.
As @Tray2 mentioned, homestead is a VM which means it has it's own IP address.
127.0.0.1 is always the localhost aka the current machine. If you want to connect to homestead's MySQL database, you need to connect to homestead's IP; typically it is 192.168.10.10.
You need the same IP if you update your /etc/hosts file (e.g. 192.168.10.10 laravel.test).