Postsql10 psql -U postgres postgres 无法登陆

刚接触postsql,选择了一个较新的版本10.4

[root@localhost data]# psql -U postgres postgres
psql: FATAL:  Ident authentication failed for user "postgres"

错误如上,su postgres用户是可以登录的。
查网上资料一直都是让我们修改/etc/postsqlxxxxx 文件,但是你会发现etc下面根本就没有这个文件。
10版本以后该文件位置在“/var/lib/pgsql/10/data/pg_hba.conf”,修改这个文件:

 79 # "local" is for Unix domain socket connections only
 80 local   all             all                                     md5
 81 # IPv4 local connections:
 82 host    all             all             127.0.0.1/32            ident
 83 # IPv6 local connections:
 84 host    all             all             ::1/128                 trust
 85 # Allow replication connections from localhost, by a user with the
 86 # replication privilege.
 87 local   replication     all                                     peer
 88 host    replication     all             127.0.0.1/32            ident
 89 host    replication     all             ::1/128                 ident
"/var/lib/pgsql/10/data/pg_hba.conf" 89L, 4268C

重启服务: systemctl start postgresql-10

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值