user2189564
user2189564

Reputation: 41

MySql Connection Issue in Laravel

I have facing mysql connection issue in laravel framework. I have added the corrent database details in env file but everytime when I run my application shows this error:

PDOException in Connector.php line 101: SQLSTATE[HY000] [2013] Lost connection to MySQL server at 'reading initial communication packet', system error: 113

Well I have create the new file to check the database connection and its working fine and also connect the database also remotely.

Upvotes: 0

Views: 475

Answers (2)

Hamza Dairywala
Hamza Dairywala

Reputation: 482

change the following in your .env file and please re verify your username and password have set correctly hope your issue will resolve

 DB_HOST=localhost

Upvotes: 0

Wouter Van Damme
Wouter Van Damme

Reputation: 781

try changing

DB_HOST=localhost

into

DB_HOST=127.0.0.1

in your .ENV file

Upvotes: 0

Related Questions