问题
With the command:
psql --dbname=mattermost --username=mmuser --password
then if I place the password it succeeds, but if I write:
psql --host=localhost --dbname=mattermost --username=mmuser --password
then the same password gives authentication fails
How can I resolve this?
回答1:
So in this one try using
psql --host=127.0.0.1 --dbname=mattermost --username=mmuser --password
check the pg_hba.conf for further info. So if below line in your pg_hba.conf file
host all all localhost trust
then it will start working with localhost also
来源:https://stackoverflow.com/questions/53802832/psql-authentication-fails-with-host-localhost