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