首先,要找到pg_hba.conf\

-->cd /var/lib/pgsql/data

-->vi pg_hba.conf

然后,将里面的配置文件修改如下:

# TYPE DATABASE USER ADDRESS METHOD

# "local" is for Unix domain socket connections only
#load all all    peer
local all all   md5
# IPv4 local connections:
#host all all 127.0.0.1/32 ident
host all all 127.0.0.1/32 md5
host all all 140.143.15.136/24 md5
host all all 112.65.61.17/32 md5
host all all 112.64.119.234/32 md5
host all all 112.65.61.93/32 md5

host  all  all  all  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

注意上面标记橙色的配置

以上两句话分别表示

1.本地访问是md5验证方式

2.远程主机,任意ip访问,md5验证方式

修改完,重启pgsql服务

-->service postgresql restart

然后,就可以在linux本机上访问本地的postgres数据库了

测试语句如下:

首先,直接在root用户下运行,如下:

-->psql -h 127.0.0.1 -d postgres -U postgres

这句话的意思是访问本地数据库,实例为postgres

然后,如果想退出该操作模式,则按Ctrl+z,即可退出该模式

看了要给好评

linux-centos-pgsql-Ident authentication failed for user “postgres”错误出现解决方法的更多相关文章

  1. CentOS 安装hping3工具及安装遇到的错误及解决方法

    hping是用于生成和解析TCPIP协议数据包的开源工具.创作者是Salvatore Sanfilippo.目前最新版是hping3,支持使用tcl脚本自动化地调用其API.hping是安全审计.防火 ...

  2. 小型SSM项目出现Failed to load ApplicationContext错误的解决方法(个人向)

    使用单元测试的时候,出现了Failed to load ApplicationContext错误,在添加了一个新的Mapper.xml文件才出现的,在保证其他配置文件没有出错的情况下,检查mapper ...

  3. Linux系统Vsftp 传文件出现 553 Could Not Create File错误的解决方法

    解决方法: 登录出现了这个错误提示:553 Could not create file SELinux设置如下 查看SELinux设置 [root@localhost ~]# getsebool -a ...

  4. centos linux 系统日常管理4 scp,rsync,md5sum,sha1sum,strace ,find Rsync 常见错误及解决方法 第十七节课

    centos linux 系统日常管理4  scp,rsync,md5sum,sha1sum,strace ,find Rsync 常见错误及解决方法  第十七节课 rsync可以增量同步,scp不行 ...

  5. pgadmin3 新建服务器出现错误 Peer authentication failed for user "postgres" 的解决办法

    转自:http://blog.csdn.net/tingyuanss/article/details/43763899 用pgadmin3 新建服务器出现错误 Peer authentication ...

  6. 新建服务器出现错误 Peer authentication failed for user "postgres" 的解决办法

    用pgadmin3 新建服务器出现错误 Peer authentication failed for user "postgres" 在stackoverflow上找到答案,出现此 ...

  7. CentOS忘记密码修改方案以及centos卡在开机登录界面,命令失效的解决方法

    CentOS忘记密码修改方案 应用场景 linux管理员忘记root密码,需要进行找回操作. 注意事项:本文基于CentOS7.2环境进行操作的,由于CentOS的版本之间是有差异的,继续之前请先确定 ...

  8. 启动 Eclipse 弹出“Failed to load the JNI shared library jvm.dll”错误的解决方法!&&在eclipse.ini中为eclipse指定jdk启动

    参考:http://blog.csdn.net/zyz511919766/article/details/7442633 http://blog.sina.com.cn/s/blog_028f0c1c ...

  9. 安装tomcat出现failed to install tomcat8 service错误及解决方法

    failed to install tomcat8 service 如下图所示:     一.安装tomcat出现failed to install tomcat6 service错误及解决方法(转载 ...

随机推荐

  1. JavaPersistenceWithHibernate第二版笔记-第六章-Mapping inheritance-008Polymorphic many-to-one associations(@ManyToOne、@Inheritance、)

    一.结构 二.代码 1. package org.jpwh.model.inheritance.associations.manytoone; import org.jpwh.model.Consta ...

  2. spoj1716 Can you answer these queries III

    传送门 (分析见正睿2018.10.1笔记) 代码 #include<iostream> #include<cstdio> #include<cstring> #i ...

  3. yzm10的小简介

    yzm10,退役OIer,现役ACMer.大学生一枚,从高中开始接触编程(入门pascal...),过程基本自学,蒟蒻一只,在各大比赛划水打酱油..15年水得noip联二后退役,结束OI之旅.也是在1 ...

  4. jquery文件上传控件 Uploadify 可以和ajax交互

    http://www.cnblogs.com/mofish/archive/2012/11/30/2796698.html  原网址 基于jquery的文件上传控件,支持ajax无刷新上传,多个文件同 ...

  5. async/await 处理异步

    async/ await来发送异步请求,从服务端获取数据,代码很简洁,同时async/await 已经被标准化. 先说一下async的用法,它作为一个关键字放到函数前面,用于表示函数是一个异步函数,因 ...

  6. 最优的cuda线程配置

    1 每个SM上面失少要有192个激活线程,寄存器写后读的数据依赖才能被掩盖   2 将 寄存器 的bank冲突降到最低,应尽量使每个block含有的线程数是64的倍数   3 block的数量应设置得 ...

  7. 前端性能优化-gzip

    为什么要开启GZIP 我们需要下载一个100KB的Javascript文件,正常的下载量就是100KB,如果我们把文件在服务端压缩一下,压缩成30kb,下载到客户端再进行解压,这样就减少了大量的HTT ...

  8. 最短路+状压DP【洛谷P3489】 [POI2009]WIE-Hexer

    P3489 [POI2009]WIE-Hexer 大陆上有n个村庄,m条双向道路,p种怪物,k个铁匠,每个铁匠会居住在一个村庄里,你到了那个村庄后可以让他给你打造剑,每个铁匠打造的剑都可以对付一些特定 ...

  9. 模仿 spring IOC Annotation版自动装配

    spring 有两大核心 IOC和AOP.  IOC (inversion of control) 译为 控制反转,也可以称为 依赖注入 ; AOP(Aspect Oriented Programmi ...

  10. 2.mybatis 的列名与数据库字段不对应

    mybatis 的列名与数据库字段不对应 1.别名 映射文件 : BlogMapper.xml <mapper namespace="com.xms.mybatis.mapper.Bl ...