linux-centos-pgsql-Ident authentication failed for user “postgres”错误出现解决方法
首先,要找到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”错误出现解决方法的更多相关文章
- CentOS 安装hping3工具及安装遇到的错误及解决方法
hping是用于生成和解析TCPIP协议数据包的开源工具.创作者是Salvatore Sanfilippo.目前最新版是hping3,支持使用tcl脚本自动化地调用其API.hping是安全审计.防火 ...
- 小型SSM项目出现Failed to load ApplicationContext错误的解决方法(个人向)
使用单元测试的时候,出现了Failed to load ApplicationContext错误,在添加了一个新的Mapper.xml文件才出现的,在保证其他配置文件没有出错的情况下,检查mapper ...
- Linux系统Vsftp 传文件出现 553 Could Not Create File错误的解决方法
解决方法: 登录出现了这个错误提示:553 Could not create file SELinux设置如下 查看SELinux设置 [root@localhost ~]# getsebool -a ...
- centos linux 系统日常管理4 scp,rsync,md5sum,sha1sum,strace ,find Rsync 常见错误及解决方法 第十七节课
centos linux 系统日常管理4 scp,rsync,md5sum,sha1sum,strace ,find Rsync 常见错误及解决方法 第十七节课 rsync可以增量同步,scp不行 ...
- pgadmin3 新建服务器出现错误 Peer authentication failed for user "postgres" 的解决办法
转自:http://blog.csdn.net/tingyuanss/article/details/43763899 用pgadmin3 新建服务器出现错误 Peer authentication ...
- 新建服务器出现错误 Peer authentication failed for user "postgres" 的解决办法
用pgadmin3 新建服务器出现错误 Peer authentication failed for user "postgres" 在stackoverflow上找到答案,出现此 ...
- CentOS忘记密码修改方案以及centos卡在开机登录界面,命令失效的解决方法
CentOS忘记密码修改方案 应用场景 linux管理员忘记root密码,需要进行找回操作. 注意事项:本文基于CentOS7.2环境进行操作的,由于CentOS的版本之间是有差异的,继续之前请先确定 ...
- 启动 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 ...
- 安装tomcat出现failed to install tomcat8 service错误及解决方法
failed to install tomcat8 service 如下图所示: 一.安装tomcat出现failed to install tomcat6 service错误及解决方法(转载 ...
随机推荐
- ROS Learning-021 learning_tf-05(编程) now() 和 Time(0) 的区别 (Python版)
ROS Indigo learning_tf-05 now() 和 Time(0)的区别 (Python版) - waitForTransform() 函数 我使用的虚拟机软件:VMware Work ...
- 算法Sedgewick第四版-第1章基础-004一封装交易对象
1. package ADT; /****************************************************************************** * Co ...
- 数字图像处理实验(5):PROJECT 04-01 [Multiple Uses],Two-Dimensional Fast Fourier Transform 标签: 图像处理MATLAB数字图像处理
实验要求: Objective: To further understand the well-known algorithm Fast Fourier Transform (FFT) and ver ...
- 7.qfilesystemmodel rowcount 为什么为0? 一个简单的model类的例子
任务: 1.新建一个空的mainwindow项目 2.debug下编译得到一个文件夹,应用程序输出这个文件夹中的文件(不显示文件夹中的文件夹) 3.使用QFileSystemModel完成. 本例显示 ...
- Spark的序列化
spark的序列化主要使用了hadoop的writable和java的Serializable. 说到底就是使用hadoop的writable替换了java的默认序列化实现方式. class Seri ...
- mingw和libcurl
想用curl来做rest的客户端.所以就研究下这方面东西. 1:安装mingw 为什么用mingw,小巧,必vs快,gcc了解的多一些, http://tdm-gcc.tdragon.net/down ...
- sql 简单的定义变量 声明 输出
--定义变量 声明 变量名 数据类型 varchar默认长度为1 --char 当字符不够时 用空格代替 declare @a char(10) --字符串用单引号 set @a ='abcdef' ...
- A. Theatre Square(math)
A. Theatre Square time limit per test 1 second memory limit per test 256 megabytes input standard in ...
- Python-OpenCV中的cv2.threshold
目录 cv2.threshold() 主要记录Python-OpenCV中的cv2,threshold()方法:官方文档 cv2.threshold() def threshold(src, th ...
- hdu1162(最小生成树 prim or kruscal模板)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1162 意义:给出一些点,用线问使所有点直接或间接连通,需要多长: 思路:裸最小生成树: 法1: pri ...