Laravel: SQLSTATE[HY000] [2002] Connection refused

24,822

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

Share:
24,822
Toyler Lainf
Author by

Toyler Lainf

Updated on July 09, 2022

Comments

  • Toyler Lainf
    Toyler Lainf almost 2 years

    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.