PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, July 15, 2022

[FIXED] Where can I find my pg_hba.conf file (for django app on a2hosting)

 July 15, 2022     django, postgresql, python-3.x, web-deployment     No comments   

Issue

I'm deploying my first ever website (it's a Python 3.7, Django 2.2.9 site on a2hosting) and I'm getting the following error when trying to run migrations.

django.db.utils.OperationalError: FATAL:  no pg_hba.conf entry for host "xx.xx.xxx.xx", user "xxxxxx", database "xxxxxx", SSL off

Googling around, I've gathered that I have to add an entry in the pg_hba.conf file for the particular user.

Problem is this is my first experience with Linux, and I can't seem to locate the pg_hba.conf file to test this solution.

Please, where can I find this file (relative to my approot)?

PS: I've successfully installed Postgresql and SSL for the site.


Solution

Welcome to Stack Overflow.

Considering you have access to the database locally, just execute SHOW hba_file; using a client of your choice to see where your pg_hba.conf file is located.

SHOW hba_file;

              hba_file               
-------------------------------------
 /etc/postgresql/11/main/pg_hba.conf
(1 Zeile)

If you feel curious about other paths and variables, take a look at SHOW ALL; ;-)



Answered By - Jim Jones
Answer Checked By - Mary Flores (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing