- 나는 설치
PostgreSQL
에EC2
기계와 지금은 사용자의 암호를 변경하려면postgres
- 나는한다
$ sudo -u postgres psql psql (9.1.5) Type "help" for help. postgres=# ALTER USER postgres WITH PASSWORD 'newpasswd'; ALTER ROLE
- 그런 다음 쉘을 종료하고 새 비밀번호로 로그인을 시도합니다
$ psql -U postgres -W Password for user postgres: psql: FATAL: Peer authentication failed for user "postgres"
내 PostgreSQL
버전은
$ psql --version
psql (PostgreSQL) 9.1.5
contains support for command-line editing
내가 뭘 잘못하고 있니?
감사합니다
UPDATE
나는 변화를 만든 pg_hba.conf
이는 지금 모습입니다
# Database administrative login by Unix domain socket
local all postgres peer
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
#local all all peer
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
그런 다음 다시 시작했습니다 postgres
$ sudo /etc/init.d/postgresql restart
* Restarting PostgreSQL 9.1 database server [ OK ]
다시 로그인을 시도했지만 실패했습니다
$ psql -U postgres -W
Password for user postgres:
psql: FATAL: Peer authentication failed for user "postgres"
아마도 이전 비밀번호는 여전히 ~ / .pgpass 파일에 저장됩니다.
@willglynn, 내 업데이트를 확인하십시오, 변경 후에도 다시 실패합니다
—
daydreamer
pg_hba.conf