psql fe_sendauth没有提供密码

XWo*_*rmX 7 postgresql

我是这类数据库的新手,我尝试通过指定psql的命令行连接到它,然后输入密码为空.我得到了上述错误(在这个问题的标题中).

我不知道默认密码是什么.

pg_hba文件:

        IPv4 local connections:
    host    all             all             127.0.0.1/32            trust
    # IPv6 local connections:
    host    all             all             ::1/128                 trust
    # Allow replication connections from localhost, by a user with the
    # replication privilege.
    host    replication     DIMA        127.0.0.1/32            trust
    host    replication     DIMA        ::1/128                 trust
Run Code Online (Sandbox Code Playgroud)

postgresql.config

listen_addresses = '*'      # what IP address(es) to listen on;
                    # comma-separated list of addresses;
                    # defaults to 'localhost', '*' = all
                    # (change requires restart)
port = 5432             # (change requires restart)
Run Code Online (Sandbox Code Playgroud)

我这样重启服务器:

C:\metasploit\postgresql\bin\pg_ctl -D "C:\metasploit\postgresql\myData" -l logfile start
Run Code Online (Sandbox Code Playgroud)

我想要的只是进入数据库并更改我的密码.并且最好进入PgAdmin-III(以GUI形式)

Cra*_*ger 2

如果您使用trust身份验证(您应该仅将其用于开发,如果是的话),则不会提示您输入密码psql

我想说你没有正确重启服务器。也许使用restart而不是start

  • @Cerin 这两者在支持 unix 套接字的平台上并不等效。后者使用 TCP/IP 来解析 `localhost` 解析为的任何 IP 地址。前者实际上就像说“psql --username=postgres --host=/var/run/pgsql”(或者无论您的“unix_socket_directory”在哪里)。我不太喜欢那个用户界面,但现在确实无法改变。在 Windows 上它们是等效的,因为它不支持 unix 套接字。 (3认同)