Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

After a gruesome night installing PostgreSQL 9.1, PostGIS 2 and Nominatim 2 on CentOS 6.3 using the instructions here, I am finally at the stage of importing a US planet file.

Problem: In ~/Nominatim/utils, When I attempt to run ./setup.php --osm-file us-northeast.osm.pbf --all, the output I get is:

["type"]=>
      string(2) "->"
      ["args"]=>
      array(2) {
        [0]=>
        array(9) {
          ["phptype"]=>
          string(5) "pgsql"
          ["dbsyntax"]=>
          string(5) "pgsql"
          ["username"]=>
          string(0) ""
          ["password"]=>
          bool(false)
          ["protocol"]=>
          string(3) "tcp"
          ["hostspec"]=>
          string(0) ""
          ["port"]=>
          bool(false)
          ["socket"]=>
          bool(false)
          ["database"]=>
          string(9) "nominatim"
        }
        [1]=>
        bool(false)
      }
    }
    [5]=>
    array(6) {
      ["file"]=>
      string(35) "/home/myusername/Nominatim/lib/db.php"
      ["line"]=>
      int(7)
      ["function"]=>
      string(7) "connect"
      ["class"]=>
      string(2) "DB"
      ["type"]=>
      string(2) "::"
      ["args"]=>
      array(2) {
        [0]=>
        string(19) "pgsql://@/nominatim"
        [1]=>
        bool(false)
      }
    }
    [6]=>
    array(4) {
      ["file"]=>
      string(40) "/home/myusername/Nominatim/utils/setup.php"
      ["line"]=>
      int(118)
      ["function"]=>
      string(5) "getDB"
      ["args"]=>
      array(0) {
      }
    }
  }
  ["callback"]=>
  NULL
}
DB Error: connect failed

and I am thrown back to the command line. I am logged in as a user who has a postgresql role of the same name and is a superuser. Any idea what went wrong? Do I need to create any database before doing this?

share|improve this question
    
Have you edited your pg_hba.conf to allow connections correctly? serverfault.com/questions/61128/… –  Mapperz Sep 10 '12 at 17:53
    
I added to pg_hba.conf the line host all myusername 0.0.0.0/25 trust and restarted postgresql-9.1, but I still get the error. Did I add this line incorrectly? –  Nyxynyx Sep 10 '12 at 18:17
    
did you change the other file too? postgresql.conf listen_addresses = '*' –  Mapperz Sep 10 '12 at 18:53
    
Yup that was changed to * too. –  Nyxynyx Sep 10 '12 at 19:57
    
I updated the error message. Is it supposed to connect without a username and password? –  Nyxynyx Sep 11 '12 at 1:15
add comment

2 Answers 2

Per the Nominatim installation instructions, it expects the installation system user and the DB user are named the same, the DB installation user be a superuser AND the pg_hba.conf have trust set for that user.

So yes, it is expected to connect without providing a username / password.

share|improve this answer
add comment

No you don't need to create base before. I have the same problem when I don't install all packages. Here you can see full instructions http://wiki.openstreetmap.org/wiki/Nominatim/Installation

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.