zoukankan      html  css  js  c++  java
  • psql: 致命错误: 对用户"user1"的对等认证失败

    操作系统:Debian8

    登录pg时可能会有提示错误:

    $ psql -U user1 -d exampledb
    psql: 致命错误: 对用户"user1"的对等认证失败

    打开以下文件,

    $ sudo vi /etc/postgresql/9.4/main/pg_hba.conf
    # TYPE DATABASE USER ADDRESS METHOD
    
    # "local" is for Unix domain socket connections only
    local all all peer
    # IPv4 local connections:
    host all all 127.0.0.1/32 md5
    # IPv6 local connections:
    host all all ::1/128 md5

    将 peer 改为md5:

    # TYPE DATABASE USER ADDRESS METHOD
    
    # "local" is for Unix domain socket connections only
    local all all md5
    # IPv4 local connections:
    host all all 127.0.0.1/32 md5
    # IPv6 local connections:
    host all all ::1/128 md5

    然后重启服务:

    $ sudo service postgresql restart

    再登录即可:

    $ psql -U user1 -d exampledb

    -- End --

  • 相关阅读:
    image对象
    Frame/IFrame 对象
    Form 对象
    JavaScript 对象 实例
    button对象
    正则介绍以及多种使用方法
    js /jquery停止事件冒泡和阻止浏览器默认事件
    一些兼容性的知识
    面试题总结
    事件
  • 原文地址:https://www.cnblogs.com/ibgo/p/5961849.html
Copyright © 2011-2022 走看看