Got “password authentication failed for user” but in pgAdmin 3 its working

ⅰ亾dé卋堺 提交于 2019-12-08 09:05:08

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!