postgresql - Postgres asks for password, even though pg_hba.conf says trust -


I have installed PostgreSQL 9.3 on my Mac. I'm trying to command:


  $ sudo -u postgres psql template1 password: password: psll: phatela: password authentication for user "postgres" has failed   

As you can see, it asks for a password, which I give it to. And this fails I try the password and computer password for the postgre user. It always says that it fails

I've read that you can change the pg_hba.conf file to not ask for a password. It is below:

  & gt; # Type Database User Address Method & gt; & Gt; # "Local" is only for Unix domain socket connection & gt; All local beliefs & gt; # IPv4 Local Connection: & gt; All 127.0.0.1/32 Faith & gt; # IPv6 local connections: & gt; Host all: 1/128 Confidence & gt; # Allow replication connections from local hosts, by user & gt; # Replication Privileges & Gt; Local Replication Postgrass Trust & gt; Host Replica Postgraduates 127.0.0.1/32 Faith & gt; Host replication postgres :: 1/128 trust   

I do not think it should ask for a password. And yet it does.

Interesting note: It logs properly in pgAdmin3. But not in the terminal

Update # 1:

I tried to restart PostgreSQL after changing the pg_hba.conf file. I get this message.

> pg_ctl -d postgres -l server.log restart pg_ctl: pid file "postgrad / postmaster.pid" does not exist What server is running? Pg_ctl is started in any way: "postgres / postmaster.opts"

I had two versions of PostgreSQL installed on my system. 8.4 and 9.3 Whenever 8.4 was installed, all default 9.3 was set to use it instead. So even though 9.3 never asks for permissions, or password, it will be 8.4.

Finally was able to kill version 8.4, which was running. Redirect traffic to 9.3 it works now!

I also set 8.4 to trust the pg_hba.conf file ... in the case of just

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -