问题
Why I can open the database from pgAdmin 3 but when I tried it on laravel, it doesn't working?
It Gives me this error
SQLSTATE[08006] [7] FATAL: password authentication failed for user "khrisna" FATAL: password authentication failed for user "khrisna"
I already tried this method by adding my own postgresql user
Here is the proof that my pgAdmin accept my user and password, I even added new "server" to make sure that my credentials are correct
So why in the laravel it says it wrong? Here is my .env
file
EDITED:
I just realized, that I can run php artisan migrate
without problems, so why the only problem is to access the database? I already hit the wall and don't know what to do or even I don't know what kind of keywords I need to type into google to get the answer.
回答1:
I was having a similar problem because I was using Homestead, so the localhost address was pointing to the virtual machine, not my computer. Changing the IP address to MY IP address worked. Or else just use the Laravel default who's user name is homestead and password is secret. It accesses Postres as a local instance on the virtual machine
来源:https://stackoverflow.com/questions/49332711/got-password-authentication-failed-for-user-but-in-pgadmin-3-its-working