[GRASSLIST:4247] Re: DBMI-Postgres driver error

Radim Blazek blazek at itc.it
Wed Aug 25 09:11:48 EDT 2004


Does 'psql -h 127.0.0.1 -U baliola grass_test' work?

Try to run  
 g.gisenv set=DEBUG=5
 db.tables -p
to see if database definition is parsed well.

Radim

On Wednesday 25 August 2004 14:47, Martin Wegmann wrote:
> On Tuesday 24 August 2004 08:17, Sabine Grabner wrote:
> > hello martin, `trust` is possibly not what you want, as your data are not
> > safe in this case. i used `md5`.
>
> well at the moment it is not important that the data is safe - it's just a
> trial on my computer.
> Despite the change to trust I still get the error messages.
> I listed below what I did:
>
> I replaced "ident" in /etc/postgresql/pg_hba.conf to "trust" where
> localhost:
>
> # TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK           METHOD
> # Database administrative login by UNIX sockets
> local   all         postgres                                        ident
> sameuser
> #
> # All other connections by UNIX sockets
> local   all         all                                             ident
> sameuser
> #
> # All IPv4 connections from localhost
> host    all         all         127.0.0.1         255.255.255.255   trust
> sameuser
> #
> # All IPv6 localhost connections
> host    all         all         ::1
> ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff        trust sameuser
> host    all         all         ::ffff:127.0.0.1/128                trust
> sameuser
> #
> # reject all other connection attempts
> host    all         all         0.0.0.0           0.0.0.0           reject
>
> psql grass_test
> create user baliola;
>
> grass_test=# select * from pg_shadow;
>  usename  | usesysid | usecreatedb | usesuper | usecatupd | passwd |
> valuntil
>
> | useconfig
>
> ----------+----------+-------------+----------+-----------+--------+-------
>---+----------- postgres |        1 | t           | t        | t         |  
>      |
>
>  baliola  |      100 | f           | f        | f         |        |
>
> (2 rows)
>
>
> but when I start grass57 and do:
>
> GRASS 5.7.0:~ > db.connect driver=pg
> database="host=127.0.0.1,dbname=grass_test,user=baliola"
> driver:pg
> database:host=127.0.0.1,dbname=grass_test,user=baliola
>
> db.test test1
>
> create table grass_test1 (i1 integer, d1 double precision, c1 varchar(20))
> DBMI-Postgres driver error:
> cannot get user/password
> [....]
> EXECUTE: ******** ERROR ********
> 0a1,3
>
> > 1|123.456000|abcd|
> > 3|0.000000|_\'_|
> > 2|18.600000|xxx|987
>
> RESULT: ******** ERROR ********
> drop table grass_test1
> DBMI-Postgres driver error:
> cannot get user/password
>
> any idea what I did wrong?
> Cheers Martin
>
> > Zitat von Martin Wegmann <wegmann at biozentrum.uni-wuerzburg.de>:
> > > On Monday 23 August 2004 16:23, Radim Blazek wrote:
> > > > And 'psql -h localhost grass_test'?
> > > > Maybe you need to edit pg_hba.conf.
> > >
> > > psql -h localhost grass_test
> > > psql: FATAL:  IDENT authentication failed for user "baliola"
> > >
> > > the non # part of pg_hba.conf looks like:
> > >
> > > #
> > > # TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK
> > > METHOD # Database administrative login by UNIX sockets
> > > local   all         postgres                                       
> > > ident sameuser
> > > #
> > > # All other connections by UNIX sockets
> > > local   all         all                                            
> > > ident sameuser
> > > #
> > > # All IPv4 connections from localhost
> > > host    all         all         127.0.0.1         255.255.255.255  
> > > ident sameuser
> > > #
> > > # All IPv6 localhost connections
> > > host    all         all         ::1
> > > ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff        ident sameuser
> > > host    all         all         ::ffff:127.0.0.1/128               
> > > ident sameuser
> > > #
> > > # reject all other connection attempts
> > > host    all         all         0.0.0.0           0.0.0.0
> > > reject
> > >
> > > I assume I have to change the 3. and 4. connection (localhost) from
> > > ident to
> > >
> > > trust .
> > >
> > > Martin
> > >
> > > > Radim
> > > >
> > > > On Monday 23 August 2004 13:54, Martin Wegmann wrote:
> > > > > hello Radim,
> > > > >
> > > > > On Monday 23 August 2004 12:43, Radim Blazek wrote:
> > > > > > GRASS cannot store passwords, if your DB requires a password
> > > > > > add it to the database parameter. Try psql first.
> > > > >
> > > > > The user is set up as a non-passwd user ('with password' is not
> > > > > used) I can enter psql grass_test without being prompted for a
> > > > > password.
> > > > >
> > > > > baliola at diomedea:~$ psql grass_test
> > > > > Welcome to psql 7.4.3, the PostgreSQL interactive terminal.
> > > > >
> > > > > Type:  \copyright for distribution terms
> > > > >        \h for help with SQL commands
> > > > >        \? for help on internal slash commands
> > > > >        \g or terminate with semicolon to execute query
> > > > >        \q to quit
> > > > >
> > > > > grass_test=#
> > > > >
> > > > > drop user baliola and created a new user with specifying a passwd:
> > > > > create user baliola with password 'test';
> > > > > however psql is not prompting for as passwd when entering the
> > > > > grass_test db.
> > > > >
> > > > > exit postgres and superuser -- starting grass57 as baliola
> > > > >
> > > > > db.connect driver=pg
> > > > > database="host=localhost,dbname=grass_test,user=baliola,password=te
> > > > >st " driver:pg
> > > > > database:host=localhost,dbname=grass_test,user=baliola,password=tes
> > > > >t
> > > > >
> > > > > db.tables -p
> > > > > DBMI-Postgres driver error:
> > > > > Cannot connect to Postgres: FATAL:  IDENT authentication failed for
> > > > > user "baliola"
> > > > >
> > > > > I did it as well with ' around the password phrase -- same result.
> > > > >
> > > > > Martin
> > > > >
> > > > > > Radim
> > > > > >
> > > > > > On Monday 23 August 2004 11:55, Martin Wegmann wrote:
> > > > > > > hello,
> > > > > > >
> > > > > > > I did my first steps with postgresql and grass and ran into
> > > > > > > some problems: First I created an user and set up a db
> > > > > > > ("grass_test")
> > > > > > >
> > > > > > > starting grass (5.7.0):
> > > > > > > db.connect driver=pg
> > > > > > > database="host=localhost,dbname=grass_test,user=baliola"
> > > > > > >
> > > > > > > I am not sure if "host=localhost" is correct. In all documents
> > > > > > > I
> > >
> > > read
> > >
> > > > > > > so far, an IP address was specified but using 127.0.0.1
> > > > > > > resulted in the same error prompt. What do I enter when
> > > > > > > postgresql is running locally?
> > > > > > >
> > > > > > > If I proceed and do  'db.test grass_test' then db.test tells me
> > > > > > > that the db must exist.
> > > > > > > If I do db.test test1 I get:
> > > > > > >
> > > > > > > DBMI-Postgres driver error:
> > > > > > > cannot get user/password
> > > > > > >
> > > > > > > and various Postgresql commands
> > > > > > >
> > > > > > > Any idea how to solve that?
> > > > > > >
> > > > > > > I am still searching for a tutorial introducing people to the
> > > > > > > postgresql inside GRASS usage, so far I found
> > > > > > > http://mpa.itc.it/markus/shortcourse/notes6.html  and
> > > > > > > the GRASS 5.7 usage example document. any links are welcome.
> > > > > > >
> > > > > > > regards, Martin




More information about the grass-user mailing list