[GIS] How to fix QGIS 1.8.0 Spit Plugin “connection failed”

postgisqgiswindows 7

I want to import shp to to postgreSQL with the spit plugin. Testing the database connection to my PostGIS database ist successfully (I already imported layers with this connection via the "add postGIS Layer" button), but if i try to connect to my db within the spit dialogue, entering the password, there will be an error message "connection failed".

I tried to use the DB Manager, three times I entered the password, then error message "unable to connect fe_sendauth: no password supplied" .. don't know, if this error is related to the above.


Have got Win7 with QGIS 1.8 and PostgreSQL 9.2. I supplied a passowrd during PostgreSQL installation to the superuser.
Editing pg-hba.conf without success. In fact, couldn't connect in pgAdmin after appending the conf-file.
hopefully, going to do the whole QGIS-PostgreSQL-installation on another machine this month.

Thanks to your answer and comment, @underdark und @RomaH!

Best Answer

The two are most likely related. A common reason for this error is not supplying a password when needed or the postgres user was created without a password and you are supplying a password.

Which OS are you using? What user are using to connect with?

Try adding a password to your user: alter user myname with password 'mypassword'; And try logging in again.

Otherwise you can try editing /etc/postgresql/x.x/main/pg-hba.conf, replace X.x with your version.

Add at the bottom:

local   all    all                        trust

This should allow anyone on your local machine to get access without a password.