Postgresql Postgres群集:用户的密码身份验证失败“;博士后&x201D;
在我的Postgres中,服务器使用命令pg_createcluster在端口5433上侦听创建了一个集群。要为用户postgres设置密码,我遵循以下步骤:Postgresql Postgres群集:用户的密码身份验证失败“;博士后&x201D;,postgresql,postgresql-9.3,multiple-instances,change-password,Postgresql,Postgresql 9.3,Multiple Instances,Change Password,在我的Postgres中,服务器使用命令pg_createcluster在端口5433上侦听创建了一个集群。要为用户postgres设置密码,我遵循以下步骤: 编辑文件nano/etc/postgresql/9.3//pg_hba.conf 换线 托管所有127.0.0.1/32 md5 排队 托管所有127.0.0.1/32信任 使用以下命令更改密码 sudo-u postgres psql-h localhost-p 5433 postgres=#\password postgres 输入新
# nano /etc/postgresql/9.3/<instance_name>/pg_hba.conf
# /etc/init.d/postgresql restart
# su - postgres
$ psql -U postgres -p 5433 -h localhost
Password for user postgres:
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# nano /etc/postgresql/9.3/<instance_name>/pg_hba.conf
# /etc/init.d/postgresql restart
# su - postgres
$ psql -U postgres -p 5433 -h localhost
postgres=# \password postgres
Enter new password:
Enter it again:
postgres=# \q
$ exit
# nano /etc/postgresql/9.3/<instance_name>/pg_hba.conf
# /etc/init.d/postgresql restart
请重新输入:
postgres=#\q
提前感谢。首先,您需要重新加载配置,以便应用所有更改。连接端口可能未打开,而且您还没有清楚地共享
本地连接的配置。这应该很好:
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 md5
谢谢你的回复。我在pg_hba.conf中看到了您的响应配置:
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 md5
更改密码:
# nano /etc/postgresql/9.3/<instance_name>/pg_hba.conf
# /etc/init.d/postgresql restart
# su - postgres
$ psql -U postgres -p 5433 -h localhost
Password for user postgres:
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# nano /etc/postgresql/9.3/<instance_name>/pg_hba.conf
# /etc/init.d/postgresql restart
# su - postgres
$ psql -U postgres -p 5433 -h localhost
postgres=# \password postgres
Enter new password:
Enter it again:
postgres=# \q
$ exit
# nano /etc/postgresql/9.3/<instance_name>/pg_hba.conf
# /etc/init.d/postgresql restart
更改密码:
# nano /etc/postgresql/9.3/<instance_name>/pg_hba.conf
# /etc/init.d/postgresql restart
# su - postgres
$ psql -U postgres -p 5433 -h localhost
Password for user postgres:
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# nano /etc/postgresql/9.3/<instance_name>/pg_hba.conf
# /etc/init.d/postgresql restart
# su - postgres
$ psql -U postgres -p 5433 -h localhost
postgres=# \password postgres
Enter new password:
Enter it again:
postgres=# \q
$ exit
# nano /etc/postgresql/9.3/<instance_name>/pg_hba.conf
# /etc/init.d/postgresql restart
面对同样的问题,找到解决方案了吗?