[OSM-dev] Permission denied errors connecting to postgres from Mapnik

Nick Black nickblack1 at gmail.com
Thu Mar 8 10:27:51 GMT 2007

Hi Nick,

   Can you connect to postgres using psql:

# psql freemap -U nick -W -h localhost -p 5432

If you get the same error connecting from the psql client, its
probably a problem with pg_hba.conf.  Mine is set like:


local   all         all                          trust

# IPv4 local connections:
host    all         all          md5

So any machines on my local network can connect with an md5 encrypted
password.  You set the password for the user at account creation time

create user foo with encrypted password 'blah'.

On 3/7/07, Nick Whitelegg <nick at hogweed.org> wrote:
> Hello Artem and everyone,
> Sorry... yet another problem :-( I'm now trying to connect to the postgis
> database from Mapnik.
> The postgresql user "nick" doesn't have a password and the postgresql server
> is running on port 5432. I could add all the OSM records in to the database
> successfully. In the mapnik xml file I have layers such as:
>  <Layer name="roads" status="on">
>     <StyleName>roads-casing</StyleName>
>     <StyleName>roads</StyleName>
>     <StyleName>secondary</StyleName>
>     <StyleName>primary</StyleName>
>     <StyleName>trunk</StyleName>
>     <StyleName>motorway</StyleName>
>     <Datasource>
>       <Parameter name="type">postgis</Parameter>
>       <Parameter name="host">localhost</Parameter>
>       <Parameter name="port">5432</Parameter>
>       <Parameter name="user">nick</Parameter>
>       <Parameter name="dbname">freemap</Parameter>
>       <Parameter name="table">(select
> way,highway,railway,landuse,"natural",man_made,waterway,tourism,learning,amenity,place,name,char_length(name)
> as length from planet_osm where waterway IS NULL and leisure IS NULL and
> landuse IS NULL) as roads</Parameter>
>     </Datasource>
>    </Layer>
> Running this from mapnik gives me an access denied error:
> connection to host=localhost port=5432 dbname=freemap user=nick password=
> connect_timeout=4 failed
> FATAL:  password authentication failed for user "nick"
> I guess I must have missed something out. Any pointers here?
> Changing "localhost" for "free-map.org.uk" is even worse.. it reports that it
> can't detect a database server running.
> Thanks,
> Nick
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev

Nick Black

More information about the dev mailing list