I am basic QGIS user and I have database created and data loaded in it. However, when I try to connect to the database, I am getting the following error.

Connection failed - consult message log for details.

All my credentials are correct.

enter image description here

  • Try switching SSL mode to 'require'
    – Encomium
    Oct 4 at 4:29
  • 3
    Have you done the required changes on the PostgreSQL config side (pg_hba.conf file) to allow external connections?
    – tjukanov
    Oct 4 at 5:39
  • Can you state the operating system you are working on. And also what versions of QGIS and Postgresql you are using? As stated above you still need to make some edits in the Postgresql config setting.
    – mapperx
    Oct 4 at 8:06
  • Hi,I am using 64-bit operating system, x64-based processor and QGIS 3.18.3 and PostgreSQL is 13.1
    – user153171
    Oct 4 at 10:49
  • Please Edit the Question in response to requests for clarification. You should also post the message log contents.
    – Vince
    Oct 4 at 11:41

Your Answer

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

Browse other questions tagged or ask your own question.