(reprint) PostgreSQL Navicat Client Connection Validation failure workaround: Password Authentication failed for user

Source: Internet
Author: User
Tags md5 postgresql psql

Command: Su-postgres

CREATE USER foo with PASSWORD ' secret ';

====================

1, 2 configuration changes

Postgresql.conf: Modify

listen_addresses = ' * '

Pg_hba.conf: Increase

# IPV4 Local connections:
Host All 127.0.0.1/32 MD5
Host All 0.0.0.0/0 MD5

2. Create user

Command: Su-postgres

CREATE USER foo with PASSWORD ' secret ';

(the original is as follows)

Redhat on the newly installed PostgreSQL9.1.3, with Psql not connected, error:

Psql.bin:FATAL:password authentication failed for user "Postgres" clearly added postgres this user, password is also simple, impossible to remember the wrong, how can not even on it? Online search, some people say that modify pg_hba.conf, the local line of MD5 change to trust. A try, sure enough. Later, the client remote login, the same problem, so I followed suit, and then changed MD5 to trust, can also login, as long as the trust of the other side, the problem is really not a problem, ah. But this approach for the server, the equivalent of the lock of their own: after the establishment of trust, there is no need for a password. I again Google, the middle of suddenly can't open the link, so had to patiently wait for 5 minutes. To fire, but there's no way.  Network blockade and network search, accidentally became a pair of enemies. Www.2cto.com Finally, God has eyes, let me find the following paragraph: PostgreSQL database password is independent of any operating system user password. Each database user's password is stored in the Pg_authid system table.passwords can be managed with the SQL language command create user and ALTER user (such as create user Foo with PASSWORD ' secret ';。 By default, if the password is not explicitly set, the stored password is empty and the user's password authentication always fails. "PostgreSQL 8.2.3 Chinese Document, 20.2 authentication method" So Ah, Pg_authid table Postgres user's password or empty it! I'll change it again, OK, this time is really good.

(reprint) PostgreSQL Navicat Client Connection Validation failure workaround: Password Authentication failed for user

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.