[GIS] Unable to connect PostgreSQL 9.5 from QGIS 2.14.1

postgresqlqgis

I created new database called "shashi" in PgAdmin III. In QGIS to create new connection I entered following details.

In PostgreSQL 9.5
pgAdmin lll
Please enter password for user postgres on server PostgreSQL 9.5: ****

In QGIS
Create a New PostGIS Connection
Name: shashidhar
Service:
Host: localhost
Port: 5432
Database: postgres
SSL mode: disable

Authentication
Username: postgres
Password: **** (same password that I used in pgAdmin lll to connect to the server )

Test connection ERROR:
Connection failed-consult message log for details

Best Answer

It looks like you have confused the username and the database name.

If you created a database called shashi, you should have Database: shashi in the QGIS PostGIS Connection window. Your username is likely postgres.

If that doesn't work, look in the message log. My logs are in /usr/local/pgsql/var/, but they may be somewhere else on your machine.