Senin, 29 September 2014

psql: FATAL: Peer authentication failed for user "xxx" di postgresql ubuntu 14.04


$ psql simpledb test
psql: FATAL:  Peer authentication failed for user "test"

The authentication service op postgresql has to be configured.

Example of configuration :

$ cd /etc/postgresql/9.1/main

backup file aslix

$cp pg_hba.conf pg_hba.conf.or

rubah seperti ini
=====================================================
# Database administrative login by Unix domain socket
local   all             postgres                                md5

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     md5
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            md5
===================================================

Restart postgresql :
$ service postgresql restart
 * Restarting PostgreSQL 9.1 database server  

postgres@vsolutions:/etc/postgresql/9.1/main$ psql simpledb test
Password for user test:
psql (9.1.3)
Type "help" for help.

simpledb=>

copas di 
http://postgres1s1.blogspot.com/2012/04/authentication-psql-simpledb-test-psql.html

Tidak ada komentar:

Posting Komentar