password settings doesn't work

Konfiguration des PostgreSQL Datenbankservers.
Antworten
maxy04
Neuer Benutzer
Beiträge: 3
Registriert: Sa 28. Sep 2013, 21:51

password settings doesn't work

Beitrag von maxy04 »

Excuse me but i don't speak deuscht.

I'm finding a problem in pg settings.
i set pg_hba.conf in this way:

local all all md5
host all all 127.0.0.1/32 md5

it does work while i do
psql -d mydb

pg ask me the password.

but if i do

psql -U postgres -d borsa

it don't ask me the password, and it is wrong.

what is the problem?

akretschmer
Erfahrener Benutzer
Beiträge: 7733
Registriert: So 29. Okt 2006, 13:35
Wohnort: Kaufbach, Sachsen, Germany, Germany
Kontaktdaten:

Re: password settings doesn't work

Beitrag von akretschmer »

maxy04 hat geschrieben:Excuse me but i don't speak deuscht.

I'm finding a problem in pg settings.
i set pg_hba.conf in this way:

local all all md5
host all all 127.0.0.1/32 md5

it does work while i do
psql -d mydb

pg ask me the password.



that's okay.

but if i do

psql -U postgres -d borsa

it don't ask me the password, and it is wrong.

what is the problem?


show us the whole pg_hba.conf, i guess there a special line for the postgres-user some lines before.

maxy04
Neuer Benutzer
Beiträge: 3
Registriert: Sa 28. Sep 2013, 21:51

Re: password settings doesn't work

Beitrag von maxy04 »

this is the whole pg_hba.conf

local all all md5
host all all 127.0.0.1/32 md5
#host all all 192.168.1.0/24 md5

there is only a commented line.

the strange thing is this: i have a raspberry pi with slackware 14(the same i have on laptop), i used the same postgresql source for compiling, i use the same pg_hba.conf, and this ask me the password.

akretschmer
Erfahrener Benutzer
Beiträge: 7733
Registriert: So 29. Okt 2006, 13:35
Wohnort: Kaufbach, Sachsen, Germany, Germany
Kontaktdaten:

Re: password settings doesn't work

Beitrag von akretschmer »

maxy04 hat geschrieben:this is the whole pg_hba.conf

local all all md5
host all all 127.0.0.1/32 md5
#host all all 192.168.1.0/24 md5

there is only a commented line.

the strange thing is this: i have a raspberry pi with slackware 14(the same i have on laptop), i used the same postgresql source for compiling, i use the same pg_hba.conf, and this ask me the password.



open psql, and execute:

show hba_file;

is this the file you edited?

maxy04
Neuer Benutzer
Beiträge: 3
Registriert: Sa 28. Sep 2013, 21:51

Re: password settings doesn't work

Beitrag von maxy04 »

yes, it is.
the postgresql.conf

data_directory = '/data/pgsql'
hba_file = '/data/pgsql/pg_hba.conf'
ident_file = '/data/pgsql/pg_ident.conf'

listen_addresses = 'localhost,192.168.1.79' # my pc
port = 5432
max_connections = 10
shared_buffers = 24MB

log_destination = 'syslog'
syslog_facility = 'LOCAL0'
syslog_ident = 'postgres'
log_min_messages = info
log_min_error_statement = info
log_line_prefix='%a %u %d %t'

datestyle = 'iso, ymd'
lc_messages = 'it_IT.utf8'
lc_monetary = 'it_IT.utf8'
lc_numeric = 'it_IT.utf8'
lc_time = 'it_IT.utf8'
default_text_search_config = 'pg_catalog.italian'

Antworten