PostgreSQL
在EC2
机器上,现在我想更改用户的密码postgres
Run Code Online (Sandbox Code Playgroud)$ sudo -u postgres psql psql (9.1.5) Type "help" for help. postgres=# ALTER USER postgres WITH PASSWORD 'newpasswd'; ALTER ROLE
Run Code Online (Sandbox Code Playgroud)$ 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
Run Code Online (Sandbox Code Playgroud)
我做错了什么?
谢谢
更新
我进行了更改pg_hba.conf
,这就是现在的样子
# Database administrative login by Unix domain socket
local all postgres peer
# TYPE DATABASE …
Run Code Online (Sandbox Code Playgroud)