- Ho installato
PostgreSQLsullaEC2macchina e ora voglio cambiare la password dell'utentepostgres - lo voglio
$ sudo -u postgres psql psql (9.1.5) Type "help" for help. postgres=# ALTER USER postgres WITH PASSWORD 'newpasswd'; ALTER ROLE
- Quindi esco dalla shell e provo ad accedere con una nuova password
$ psql -U postgres -W Password for user postgres: psql: FATAL: Peer authentication failed for user "postgres"
La mia PostgreSQLversione è
$ psql --version
psql (PostgreSQL) 9.1.5
contains support for command-line editing
Che cosa sto facendo di sbagliato?
Grazie
AGGIORNAMENTO
Ho apportato modifiche pg_hba.confe questo è come appare ora
# 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
Quindi ho riavviato il postgres
$ sudo /etc/init.d/postgresql restart
* Restarting PostgreSQL 9.1 database server [ OK ]
Ho provato ad accedere nuovamente, ma non ci sono riuscito
$ psql -U postgres -W
Password for user postgres:
psql: FATAL: Peer authentication failed for user "postgres"
pg_hba.confsia impostato in modo tale da non accettare l'autenticazione con password.
pg_hba.conf