Does anyone know a way to save my username for PostGIS in QGIS, so I'll always be logged in without the need to enter my username and password everytime?

Anytime I start new project in QGIS, I need to log in and enter my username and my password and I wonder if there is any way that it will always be logged in and I'll not have to insert my username and password.

  • 2
    Is it PostGIS or QGIS or Postgis under QGIS ? Please be more explicit. – J. Monticolo Aug 5 '19 at 14:07
  • I saw the tags but for clarity and question referencing, it's not ideal. – J. Monticolo Aug 5 '19 at 14:40
  • Please add more details – Mapperz Aug 5 '19 at 15:58
  • I have edit it, I meant Postgresql in qgis. I'm bew to this so i'm sorry if it sounds confusing – Reut Aug 5 '19 at 16:20

If you want to save the connection settings to your PostGresql database to avoid typing your password every time in Qgis.

You can use a pgpass configuration file : https://www.postgresql.org/docs/current/libpq-pgpass.html

it's a text file situated in your user space and you just need to type your login:password in this file. This file should exist in your installation (otherwise create it), you just need to edit it and add your login:password

NB : it's not safe to use it this way but it's ok if it's a local database.

  • thank you for the answer. I'm new to this. so I would love to know, what is the user space, how can I find it ? this text fille should cintain only the code as appaeard in that link with the correct data filled in this- hostname:port:database:username:password -and can I create it on notepad and then just put this text document in my user space? – Reut Aug 18 '19 at 9:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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