canfiax
1 year ago
115
1
Laravel

Error running PostgreSQL in terminal - SQLSTATE[08006] [7] FATAL: password authentication failed for user "myusername"

Posted 1 year ago by canfiax

When using PostgreSQL on my local laravel installation, running php artisan migrate results in the following error:

SQLSTATE[08006] [7] FATAL:  password authentication failed for user "myusername"

However, I don't provide myusername anywhere in my app. For some strange reason, laravel could be taking myusername which also happens to be my username on my local OS user, running the artisan command.

I don't seem to know why it doesn't work. If I visit my application in the browser, I see error message: SQLSTATE[42P01]: Undefined table: 7 ERROR: relation \"users\" does not exist\nLINE 1: select * from \"users\" where \"email\" = $1 limit 1\n ^ (SQL: select * from \"users\" where \"email\" = [email protected] limit 1), so it seems as though the credentials in .env is correct, we just need to run the migrations.

Please sign in or create an account to participate in this conversation.