Laravel Sail - SQLSTATE[HY000] [2002] No such file or directory in Docker
- Published on
- /1 mins read/---
There are lots of DEV still using xampp for laravel & php development environmemt. To be honest i used that long time.
From few months, have been using laravel sail (WSL2+Docker), its amazing. But i got an issue after first "sail up" command. Somehow i got error when trying to migrate database by sail artisan migrate.
Looking for solution, tried many things. but wasn't success. But also got some solution , dont knwo which is efficiant. Somehow it works. I am not so experined in docker, co acn't suggest you about better.
Error : SQLSTATE[HY000] [2002] No such file or directory
first Solution
second Solution
I prefer first solution over second one. Cause you don't need to change the ip manully all the time.
Thanks