I'm using Laravel Sail with WSL 2 and pgSQL, and I'm facing issues connecting to the databases and running migrations. It has worked on other devices and for my colleagues, but now I'm encountering problems, and I'm not sure what to do.

I'm attaching screenshots for reference.

env enter image description here

docker-compose enter image description here

config/database.php enter image description here

start sail enter image description here enter image description here

artisan migrate enter image description here

I have tried rebuilding Sail, changing the password, and even setting up on another Ubuntu instance that I downloaded from the Microsoft Store. I have uninstalled WSL, reinstalled it, and redeployed the project. In general, I'm at a loss.

1

There are 1 best solutions below

0
RogerPontare On

Yo.

You probably have scram enabled in postgres but the database has the old md5 style or the worse password style, or maybe the other way...

Could also be that you forgott the pg_hba.conf to allow.

Check it out.

https://www.postgresql.org/docs/current/auth-password.html

https://stackoverflow.com/a/7696398/23206904