转自:http://blog.csdn.net/tingyuanss/article/details/43763899

用pgadmin3 新建服务器出现错误 Peer authentication failed for user "postgres"

在stackoverflow上找到答案,出现此错误的原因是:

Peer authentication 是默认的配置,如果你的计算机用户名和你的postgres数据库名是一样的话,那么就不会出现此错误,不需要为你的数据库设置密码。

还有一种md5 authentication,它需要密码。

而我的计算机用户名和我的数据库名不一致,所以需要把Peer authentication改成md5 authentication,然后给数据库设置密码。

在哪里改?

/etc/postgresql/9.3/main/pg_hba.conf

执行命令

找到下面的一行:

local   all             postgres                                peer

改成

local   all             postgres                                md5

然后restart postgresql server

sudo service postgresql restart

pgadmin3 新建服务器出现错误 Peer authentication failed for user "postgres" 的解决办法的更多相关文章

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

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

  2. pg_dump: [archiver (db)] connection to database “dbase” failed: FATAL: Peer authentication failed for user “postgres”

    "Peer authentication" means that it's comparing your database username against your Linux ...

  3. CAS (10) —— JBoss EAP 6.4下部署CAS时出现错误exception.message=Error decoding flow execution的解决办法

    CAS (10) -- JBoss EAP 6.4下部署CAS时出现错误exception.message=Error decoding flow execution的解决办法 jboss版本: jb ...

  4. JVM 崩溃 Failed to write core dump解决办法 WINDOWS

    JVM 崩溃 Failed to write core dump解决办法 WINDOWS MIT key words: JVM,崩溃,windows,Failed,core dump,虚拟内存 最近从 ...

  5. 【转载】Android Gradle Build Error:Some file crunching failed, see logs for details解决办法

    Android Gradle Build Error:Some file crunching failed, see logs for details解决办法 转载请标明出处: http://www. ...

  6. 远程连接MySQL错误“plugin caching_sha2_password could not be loaded”的解决办法

    远程连接MySQL错误"plugin caching_sha2_password could not be loaded"的解决办法 问题描述: 今天在阿里云租了一个服务器,当我用 ...

  7. Authentication token manipulation error报错解决办法

    Authentication token manipulation error报错解决办法 #参考http://blog.163.com/junwu_lb/blog/static/1916798920 ...

  8. mongodb 错误 SCRAM-SHA-1 authentication failed for --转

    log 日志错误信息 2018-10-24T16:14:42.244+0800 I NETWORK [initandlisten] connection accepted from 192.168.1 ...

  9. Rails: could not connect to database postgres: FATAL: Peer authentication failed for user "username"

    /var/lib/pgsql/9.2/data/pg_hba.conf 打开之后找到 local all postgres/all peer 改成 local all postgres trust 保 ...

随机推荐

  1. Postman怎么用?

    国庆期间的工作就是搞清楚postman怎么用?

  2. [SOJ] shortest path in unweighted graph

    Description 输入一个无向图,指定一个顶点s开始bfs遍历,求出s到图中每个点的最短距离. 如果不存在s到t的路径,则记s到t的距离为-1.   Input 输入的第一行包含两个整数n和m, ...

  3. centos6 + tomcat+ jdk配置步骤

    1. 获取tomcat, jdk安装文件 mkdir /media/smbdirmount -o username=pas,password=111111 //109.110.100.50/pas / ...

  4. python修炼7----迭代器

    迭代器 -------------------------------------------------------------------------------- 充电小知识 1.yield-- ...

  5. NIC Bonding: 2 nic port as 1 interface

    The following is concluded from here. Consider we have 2 interfaces: eth0 & eth1 bond the two in ...

  6. XAMPP 的MYSQL无法启动

    最近在学习小程序,小程序的后台cms系统需要安装XAMPP软件,这个软件是个集成软件,里面有MySql 和 Apache 等 ,首先进入小程序后台时需要启动MySql 和 Apache Apache ...

  7. public static void main(String[] args){} 关于Java main()方法

    是Java程序的入口方法,JVM在运行程序时,会首先查找main()方法. public是权限修饰符,表明任何类或对象都可以访问这个方法: static表明main()方法是一个静态方法,即方法中的代 ...

  8. javaWEB总结(16):jsp错误页面的处理

    前言 网站上线后,jsp页面上有时会出现不友好的错误信息,我们需要展示给用户更加友好的页面.这时候要用到page标签的errorPage和isErrorPage. errorPage 指定当前页面出现 ...

  9. 你会用::before、::after吗

    ::before和::after伪元素的用法 一.介绍 css3为了区分伪类和伪元素,伪元素采用双冒号写法. 常见伪类——:hover,:link,:active,:target,:not(),:fo ...

  10. Java多线程:线程同步与关键字synchronized

    一.同步的特性1. 不必同步类中所有的方法, 类可以同时拥有同步和非同步方法.2. 如果线程拥有同步和非同步方法, 则非同步方法可以被多个线程自由访问而不受锁的限制. 参见实验1:http://blo ...