Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel: SQLSTATE[HY000] [2002] Connection refused

I am using Vagrant with fresh laravel 5.4 installed. After I run auth I have ran the migrate to migrate the MySQL tables. All of these process successful but when I try to login or register to test the system I am getting error:

SQLSTATE[HY000] [2002] Connection refused.

But my database working perfect since I already able to migrate the tables. Whats possible solution could be? check attached image (I'm using Ubuntu 16.04)

Connection refused.

like image 829
Toyler Lainf Avatar asked Nov 29 '22 22:11

Toyler Lainf


1 Answers

Try changing your DB_HOST from 127.0.0.1 to localhost. and if still not working try using the default mysql port to 3306

like image 164
Onix Avatar answered Dec 05 '22 20:12

Onix