Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Postgres running via on rails already and am trying to connect QGis to the database.

PostGIS is working already. (questions already found online deal with this issue only)

I do not have a password or username set up for this database, as indicated in my database.yml file for rails:

  adapter: postgis
  encoding: unicode
  postgis_extension: true
  schema_search_path: public,postgis
ffsdfsdfsdf  pool: 5
  database: gisdatabase
  host: localhost

So I've gone into QGis and am trying to set up a new PostGIS connection:

Host: localhost
Port: 5432
Database: gisdatabase
SSLMode: allow

I've changed the port around and managed to get this error:

"could not connect to server: Connection refused..."

Changing the port back to 5432, I get a different error, thus indicating that the connection is not being refused:

"Connection failed - Check settings and try again."

I'm thinking that perhaps its the blank "Service" form or perhaps an error with the empty username and password fields that are causing the error, but I don't really know.

I've tried to find the correct Service name but have been unsuccessful

share|improve this question
I would add a username/password (even if it is the same). sounds like you need to edit the pg_hba.conf file – Mapperz Aug 23 '13 at 17:04

In my experience, QGIS won't accept a connection without username and password. You will have to set one.

share|improve this answer

Your Answer


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.