pgadmin gives me the error: no password supplied

前端 未结 4 1863
南笙
南笙 2020-12-30 23:49

I\'ve installed postgresql 9.2 on linux (kubuntu) and the last version of pgadmin3, but when I connect them I have this error:

An error has occurred: Error connectin

4条回答
  •  感动是毒
    2020-12-31 00:13

    Whether a password is required depends on your settings in pg_hba.conf. And there are different ways you can connect - different settings in pg_hba.conf may apply.

    I quote the help shipped with pgAdmin 3 for the "Host" field in the connection ("server") settings:

    The host is the IP address of the machine to contact, or the fully qualified domain name. On Unix based systems, the address field may be left blank to use the default PostgreSQL Unix Domain Socket on the local machine, or be set to an alternate path containing a PostgreSQL socket. If a path is entered, it must begin with a “/”. The port number may also be specified.

    If you connect via Unix socket the rules for "local" apply. Whereas when connecting via TCP/IP "host" (or "hostssl") rules applies.

    If you have a line like this at the top your pg_hba.conf file:

    local    all     all     peer
    

    or:

    local    all     all     ident
    

    .. then you can connect locally without password if your system user is "postgres" and your database user is "postgres", too.

提交回复
热议问题