#735 closed bug (invalid)
can't connect to postgres without password
Reported by: | msieczka | Owned by: | nobody |
---|---|---|---|
Priority: | major: does not work as expected | Milestone: | |
Component: | SPIT | Version: | 0.8.1 |
Keywords: | Cc: | ||
Must Fix for Release: | Yes | Platform: | Debian |
Platform Version: | Ubuntu Dapper | Awaiting user input: | no |
Description
When I try to connect or test a connection to a PostGIS database as user that has no password I get an error:
fe_sendauth: no password supplied
The user has no password, so QGIS should not demand it.
To workaround this I had to add password for my postgresql user.
Setup:
postgresql 8.1.9, postgis 1.2.1, QGIS 0.8.2 + SVN 7052
Change History (5)
comment:1 by , 17 years ago
comment:2 by , 17 years ago
I'm not using PGAdmin or any other GUI.
But I'm sure when my role doesn't have a password it works from the command line, eg.:
psql --username myname --dbname mydatabse
I'm not prompted for a password and all is OK. For QGIS to my PostgreSQL role to work I have to set a password for it and enter it in QGIS. Otherwise I get the error as mentioned.
The PostgreSQL server and client is localhost.
follow-up: 4 comment:3 by , 17 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
This is not a bug. QGIS uses tcp/ip connections to PostgreSQL, regardless of whether both client and server are on the same host. You can configure PostgreSQL to accept such connections as trusted, however doing so may be a security risk depending on your environment.
The reason it works from psql for you is that your user is trusted for *local* connections using sockets. If you want to allow connections from QGIS without a password you can modify your pg_hba.conf file and add a line similar to this:
host mydatabase myuser 127.0.0.1/32 trust
This will allow the user "myuser" trusted access to database "mydatabase" when connecting from QGIS on the localhost.
comment:4 by , 17 years ago
Replying to gsherman:
This is not a bug. QGIS uses tcp/ip connections to PostgreSQL, regardless of whether both client and server are on the same host.
Absolutely correct. Thanks Garry and very sorry for the fuss.
Maciek
Are you sure is a QGis problem? Can you connect to PostgreSQL from command line or from PGAdmin without a password? I have several connections to PostgreSQL servers without a password and the servers are located on localhost and over a LAN. I have configured PostgreSQL server to trust connections from convenient IP's and doesn't require passwords.