postgresql 安装成功后,使用链接语句链接

[root@iZbp1hdum7hefdeb75mnyfZ ~]# psql -d postgres -U postgres -W
Password for user postgres:
psql (9.6.24)
Type "help" for help.postgres=#
postgres=#
postgres=#

这样链接并没有报错,但是这样登录就会报错误

[root@iZbp1hdum7hefdeb75mnyfZ ~]# psql -hlocalhost -d postgres -U postgres -W
Password for user postgres:
psql: FATAL:  Ident authentication failed for user "postgres"
[root@iZbp1hdum7hefdeb75mnyfZ ~]# psql -h127.0.0.1 -d postgres -U postgres -W
Password for user postgres:
psql: FATAL:  Ident authentication failed for user "postgres"

Navicat的远程链接也会报错Ident authentication failed for user “postgres”

修改

vim /var/lib/pgsql/9.6/data/pg_hba.conf

将IPv6等注释掉


# TYPE  DATABASE        USER            ADDRESS                 METHOD# "local" is for Unix domain socket connections only
local   all             postgres                                md5
# IPv4 local connections:
#host    all             all             127.0.0.1/32            ident
host    all             all             0.0.0.0/0               md5
host    replication     replica         10.29.0.0/16            md5# IPv6 local connections:
#host    all             all             ::1/128                 ident
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            ident
#host    replication     postgres        ::1/128                 ident

重新启动postgresql

systemctl restart postgresql-9.6.service

再次链接就好用了

[root@iZbp1hdum7hefdeb75mnyfZ ~]# psql -h localhost -p 5432 -U postgres
Password for user postgres:
psql (9.6.24)
Type "help" for help.postgres=# 

postgresql安装后链接报错psql: FATAL: Ident authentication failed for user “postgres“相关推荐

  1. OperationalError: FATAL: Ident authentication failed for user “postgres”

    OperationalError: FATAL: Ident authentication failed for user "dbuser" 出现这个错误的原因还是在于上面pg_h ...

  2. PostgreSQL提示:‘psql: FATAL: ”Peer authentication failed for user ”postgres“’错误#将文件Database administ

    #将文件Database administrative 下列中的peer改为trust $sudo nano /etc/postgresql/10/main/pg_hba.conf #重新加载配置 $ ...

  3. postgresql 开启远程访问、postgre设置开机自启动、psql: error: FATAL: Peer authentication failed for user “postgres“

    文章目录 一.psql: error: FATAL: Peer authentication failed for user "postgres" 二.postgresql 开启远 ...

  4. 【PostgreSQL】FATAL: Ident authentication failed for user

    问题描述 项目部署在服务器上(数据库postgresql同样是安装在该服务器上),启动时发现报错,org.postgresql.util.PSQLException: FATAL: Ident aut ...

  5. FATAL: password authentication failed for user postgres

    FATAL: password authentication failed for user "postgres" 致命:用户"postgres"的密码验证失败 ...

  6. VS2017链接报错:fatal error LNK1318: 非意外的 PDB 错误

    今天编译的时候出现了 : fatal error LNK1318: 非意外的 PDB 错误: NOT_IMPLEMENTED (9)  找了很久,后来对比sample里面的配置选项,终于解决问题: 中 ...

  7. 解决win7 64位操作系统下安装PL/SQL后连接报错问题: make sure you have the 32 bits oracle client installed

    解决win7 64位操作系统下安装PL/SQL后连接报错问题: make sure you have the 32 bits oracle client installed 参考文章: (1)解决wi ...

  8. xshell进行ssh链接报错“所选的用户密钥未在远程主机上注册”处理

    xshell进行ssh链接报错"所选的用户密钥未在远程主机上注册"处理 一.报错情况 二.控制台登录主机 三.解决步骤 1.重新生成公私钥 2./root/.ssh/authori ...

  9. VS Code远程链接报错Could not establish connection to “hz-t2.matpool.com”

    VS Code远程链接报错Could not establish connection to "hz-t2.matpool.com" 输出的部分内容 ## 解决方法1 git fo ...

最新文章

  1. unknown type name 'uint32_t'
  2. Multi-Temporal SAR Data Large-Scale Crop Mapping Based on U-Net Model(利用U-net对多时相SAR影像获得作物图)...
  3. 卸载vuecli3_卸载vue2.0并升级vue_cli3.0的实例讲解
  4. 学学python(4):面向对象及类,模块
  5. .NET Core 3.0 中的数据库驱动框架 System.Data
  6. Akamai “三驾马车”,如何应对疫情后新场景形态下的新考验?
  7. 产品经理需要掌握的9种共性推荐策略
  8. arcengine 图层中节点抽稀功能(c++)
  9. JAVA实现图的邻接表以及DFS
  10. 统计自然语言处理基础——学习摘要(1)
  11. rup软件测试案例,胖子说RUP - 软件测试网 _领测软件测试网站-中国软件测试技术第一门户...
  12. JavaWebDay13_课程回顾,Tomcat软件,Servlet入门.
  13. Micro-personnel部署
  14. 2018界面情感化设计,拒绝冷冰冰的人机交流
  15. 详细讲解Java整数类型
  16. shell小实验详解1——for循环语句实现求奇数和与偶数和+小技巧使用!!!
  17. Android十大开源框架
  18. Hook DirectX 在War3 魔兽争霸界面写屏
  19. android 浏览器控件
  20. 编辑出库单issue

热门文章

  1. WPF系列教程——(一)仿TIM QQ界面 - 简书
  2. java计算网络吞吐量_Jmeter中的吞吐量计算
  3. 使用RMSE分析数据
  4. win10 开机慢优化方法
  5. 使用CocoaPods安装SDK
  6. 微软服务器系统还原,怎么进行windows server 2003系统还原
  7. HDD和SSD的比较
  8. Python声学特征神经网络构建区域响度图
  9. Bigtable 论文阅读
  10. python发邮件模板