Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

khrisnagunanasurya's avatar

Fresh-installation laravel project can't access postgresql database but can do php migrate

I already asked this question on stackoverflow 2 times, here is the links to the first one https://stackoverflow.com/questions/49332711/got-password-authentication-failed-for-user-but-in-pgadmin-3-its-working

But I still didn't get an answer to solve the problem.

So I tried to create a new laravel project, then edit the .env file, check if php artisan migrate can run.

After I run php artisan migrate it's running, so it means that my credentials to postgresql database is correct right? if not it will tell you password authentication failed for user "postgres", but I don't getting any error at all, so I going to the next step. Now after I make sure everything is OK i run php artisan make:auth, it's a success without error at all, so I go to the web browser then run the site, I clicked the register / login button, fill the fields, submit then, it's happened again the nightmare

I got this message from the website

SQLSTATE[08006] [7] FATAL: password authentication failed for user "postgres" FATAL: password authentication failed for user "postgres" (SQL: select count(*) as aggregate from "users" where "email" = [email protected])

Even though php artisan migrate run really well, so I've no idea why it's happening. Is there somebody that ever run to this problem before? or maybe why it's happening?

I already search all keywords that possible to fix this problem, but I can't found the answer, it's really stressed me out. So I hope, you guys can help me with this problem, thank you

for info I'm using:

PostgreSQL 9.6.8

Laravel 5.6

Ubuntu 17.10

0 likes
0 replies

Please or to participate in this conversation.