PostgreSQL:Windows创建新实例但无法使用pgAdmin3登录

时间:2016-11-23 03:20:28

标签: windows postgresql postgresql-9.5

我为postgesql创建了新实例,但是无法使用pgAdmin3

登录

我正在使用Windows 7和PostgreSQL 9.5

这就是我所做的:

  1. 在D盘中提取postgresql-9.5.0-1-windows-x64-binaries

  2. 打开cmd(管理员帐户)

  3. 创建数据文件夹

  4. 使用initdb命令

  5. 使用pg_ctl命令启动和停止日志文件

  6. 使用pg_ctl register命令注册服务

  7. 编辑postgresql.conf

    change port from 5432 to 5433
    listen_addresses = localhost
    listen_addresses = *
    
  8. 编辑pg_hba.conf

    Add IPv4 local connections
    host    all             all     samenet             md5
    
  9. 启动服务

  10. 最后,在新实例创建的数据文件夹中添加完全控制的网络和本地服务。

  11. ------在此过程中我没有遇到任何问题。

    但是当我使用pgAdmin3登录postgres帐户甚至管理员帐户时,会发生同样的错误。

    enter image description here

    enter image description here

    我不知道我错过了什么。

1 个答案:

答案 0 :(得分:0)

尝试将身份验证方法更改为信任。因此,您无需密码即可登录。

Add IPv4 local connections
host    all             all     127.0.0.1/32         trust

在我的情况下,我允许所有localhost用户无需密码登录。

如果您使用md5客户端将需要密码进行身份验证,如果您使用trust客户端可以无需密码登录。