• 技术文章 >数据库 >PostgreSQL

    postgresql如何登录

    silencementsilencement2020-03-12 20:41:53原创3231

    postgresql登录失败的解决方法:

    确认phpPgAdmin是否可以链接到postgresql数据库,方法:查看data/pg_log下的log有没有phpPgAdmin的访问记录,有则说明可以

    链接。

    推荐:postgresql教程

    查看postgresql的认证方法:pg_hba.conf

    # "local" is for Unix domain socket connections only
    local   all         all                               ident
    # IPv4 local connections:
    host    all         all         127.0.0.1/32          md5
    # IPv6 local connections:
    host    all         all         ::1/128               md5

    看着好像跟ident认证方式有点关系,最后在官方文档找到一句话:

    When using an external authentication system like Ident or GSSAPI, the name of the operating system 
    user that 
    initiated the connection might not be the same as the database user he needs to connect as.

    明白了,原来上面的[local all all ident]搞的鬼,如果是ident的话需要配置 pg_ident.conf文件,所以果断换成除以上两种

    加密方式外的方法

    重启postgresql:

    #service postgresql restart.

    再访问一次,成功。

    更多技术请关注Python视频教程

    专题推荐:数据库
    品易云
    上一篇:怎么才能进入postgresql数据库 下一篇:postgresql异常怎么重启

    相关文章推荐

    • postgresql10怎么创建数据库用户

    全部评论我要评论

    © 2021 Python学习网 苏ICP备2021003149号-1

  • 取消发布评论
  • 

    Python学习网