When trying to connect to an external postgres database using pgAdmin, I get an error












2















I get the following error when trying to connect:




"FATAL: no pg_hba.conf entry for host "", user "postgres", database "postgres", SSL off"




The db is installed on an Ubuntu machine in Azure. I have allowed inbound connections on port 5432, so there should be no issue there however.



I have edited and added the following lines to the /etc/postgresql/9.5/main/pg_hba.conf file on the server:



host all all 0.0.0.0/0 md5
hostssl all all 0.0.0.0/0 md5


even when I tried to change the mode to trust, I couldn't get a connection established.



I also edited the listen addresses to be: "listen_addresses = '*'" in /etc/postgresql/9.5/main/postgresql.conf.



I have ran the command service postgresql restart after making each of the changes.










share|improve this question
















bumped to the homepage by Community 1 min ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Can you connect it from the command line? psql --host=your.azure.ip --port=5432 --user=yourUserName? I suspect a pgadmin misconfiguration is more likely.

    – peterh
    Jun 10 '18 at 17:05











  • Same error comes up. I also added local all all md5 before testing this. When i change user on the machine to by "su postgres" and just write psql it works

    – user3213378
    Jun 10 '18 at 17:22













  • Then my second most likely reason is that the DB is using actually a different pg_hba.conf, not the one you are editing.

    – peterh
    Jun 10 '18 at 17:27











  • The changes you've wrote should make it working. It is a highly misterious problem for me. What is in /var/log/postgresql ?

    – peterh
    Jun 10 '18 at 17:28
















2















I get the following error when trying to connect:




"FATAL: no pg_hba.conf entry for host "", user "postgres", database "postgres", SSL off"




The db is installed on an Ubuntu machine in Azure. I have allowed inbound connections on port 5432, so there should be no issue there however.



I have edited and added the following lines to the /etc/postgresql/9.5/main/pg_hba.conf file on the server:



host all all 0.0.0.0/0 md5
hostssl all all 0.0.0.0/0 md5


even when I tried to change the mode to trust, I couldn't get a connection established.



I also edited the listen addresses to be: "listen_addresses = '*'" in /etc/postgresql/9.5/main/postgresql.conf.



I have ran the command service postgresql restart after making each of the changes.










share|improve this question
















bumped to the homepage by Community 1 min ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • Can you connect it from the command line? psql --host=your.azure.ip --port=5432 --user=yourUserName? I suspect a pgadmin misconfiguration is more likely.

    – peterh
    Jun 10 '18 at 17:05











  • Same error comes up. I also added local all all md5 before testing this. When i change user on the machine to by "su postgres" and just write psql it works

    – user3213378
    Jun 10 '18 at 17:22













  • Then my second most likely reason is that the DB is using actually a different pg_hba.conf, not the one you are editing.

    – peterh
    Jun 10 '18 at 17:27











  • The changes you've wrote should make it working. It is a highly misterious problem for me. What is in /var/log/postgresql ?

    – peterh
    Jun 10 '18 at 17:28














2












2








2








I get the following error when trying to connect:




"FATAL: no pg_hba.conf entry for host "", user "postgres", database "postgres", SSL off"




The db is installed on an Ubuntu machine in Azure. I have allowed inbound connections on port 5432, so there should be no issue there however.



I have edited and added the following lines to the /etc/postgresql/9.5/main/pg_hba.conf file on the server:



host all all 0.0.0.0/0 md5
hostssl all all 0.0.0.0/0 md5


even when I tried to change the mode to trust, I couldn't get a connection established.



I also edited the listen addresses to be: "listen_addresses = '*'" in /etc/postgresql/9.5/main/postgresql.conf.



I have ran the command service postgresql restart after making each of the changes.










share|improve this question
















I get the following error when trying to connect:




"FATAL: no pg_hba.conf entry for host "", user "postgres", database "postgres", SSL off"




The db is installed on an Ubuntu machine in Azure. I have allowed inbound connections on port 5432, so there should be no issue there however.



I have edited and added the following lines to the /etc/postgresql/9.5/main/pg_hba.conf file on the server:



host all all 0.0.0.0/0 md5
hostssl all all 0.0.0.0/0 md5


even when I tried to change the mode to trust, I couldn't get a connection established.



I also edited the listen addresses to be: "listen_addresses = '*'" in /etc/postgresql/9.5/main/postgresql.conf.



I have ran the command service postgresql restart after making each of the changes.







postgresql ubuntu azure-vm pgadmin-4






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 10 '18 at 18:33









peterh

1,01741429




1,01741429










asked Jun 10 '18 at 16:39









user3213378user3213378

111




111





bumped to the homepage by Community 1 min ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 1 min ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • Can you connect it from the command line? psql --host=your.azure.ip --port=5432 --user=yourUserName? I suspect a pgadmin misconfiguration is more likely.

    – peterh
    Jun 10 '18 at 17:05











  • Same error comes up. I also added local all all md5 before testing this. When i change user on the machine to by "su postgres" and just write psql it works

    – user3213378
    Jun 10 '18 at 17:22













  • Then my second most likely reason is that the DB is using actually a different pg_hba.conf, not the one you are editing.

    – peterh
    Jun 10 '18 at 17:27











  • The changes you've wrote should make it working. It is a highly misterious problem for me. What is in /var/log/postgresql ?

    – peterh
    Jun 10 '18 at 17:28



















  • Can you connect it from the command line? psql --host=your.azure.ip --port=5432 --user=yourUserName? I suspect a pgadmin misconfiguration is more likely.

    – peterh
    Jun 10 '18 at 17:05











  • Same error comes up. I also added local all all md5 before testing this. When i change user on the machine to by "su postgres" and just write psql it works

    – user3213378
    Jun 10 '18 at 17:22













  • Then my second most likely reason is that the DB is using actually a different pg_hba.conf, not the one you are editing.

    – peterh
    Jun 10 '18 at 17:27











  • The changes you've wrote should make it working. It is a highly misterious problem for me. What is in /var/log/postgresql ?

    – peterh
    Jun 10 '18 at 17:28

















Can you connect it from the command line? psql --host=your.azure.ip --port=5432 --user=yourUserName? I suspect a pgadmin misconfiguration is more likely.

– peterh
Jun 10 '18 at 17:05





Can you connect it from the command line? psql --host=your.azure.ip --port=5432 --user=yourUserName? I suspect a pgadmin misconfiguration is more likely.

– peterh
Jun 10 '18 at 17:05













Same error comes up. I also added local all all md5 before testing this. When i change user on the machine to by "su postgres" and just write psql it works

– user3213378
Jun 10 '18 at 17:22







Same error comes up. I also added local all all md5 before testing this. When i change user on the machine to by "su postgres" and just write psql it works

– user3213378
Jun 10 '18 at 17:22















Then my second most likely reason is that the DB is using actually a different pg_hba.conf, not the one you are editing.

– peterh
Jun 10 '18 at 17:27





Then my second most likely reason is that the DB is using actually a different pg_hba.conf, not the one you are editing.

– peterh
Jun 10 '18 at 17:27













The changes you've wrote should make it working. It is a highly misterious problem for me. What is in /var/log/postgresql ?

– peterh
Jun 10 '18 at 17:28





The changes you've wrote should make it working. It is a highly misterious problem for me. What is in /var/log/postgresql ?

– peterh
Jun 10 '18 at 17:28










1 Answer
1






active

oldest

votes


















0














The cause of the is the bold part, the host "":




"FATAL: no pg_hba.conf entry for host "", user "postgres", database "postgres", SSL off"




The database, from which you get the error, see a local connection, and not a networked one.



How can it happen, it depends on your system configuration, what you didn't share here.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "182"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f209236%2fwhen-trying-to-connect-to-an-external-postgres-database-using-pgadmin-i-get-an%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    The cause of the is the bold part, the host "":




    "FATAL: no pg_hba.conf entry for host "", user "postgres", database "postgres", SSL off"




    The database, from which you get the error, see a local connection, and not a networked one.



    How can it happen, it depends on your system configuration, what you didn't share here.






    share|improve this answer




























      0














      The cause of the is the bold part, the host "":




      "FATAL: no pg_hba.conf entry for host "", user "postgres", database "postgres", SSL off"




      The database, from which you get the error, see a local connection, and not a networked one.



      How can it happen, it depends on your system configuration, what you didn't share here.






      share|improve this answer


























        0












        0








        0







        The cause of the is the bold part, the host "":




        "FATAL: no pg_hba.conf entry for host "", user "postgres", database "postgres", SSL off"




        The database, from which you get the error, see a local connection, and not a networked one.



        How can it happen, it depends on your system configuration, what you didn't share here.






        share|improve this answer













        The cause of the is the bold part, the host "":




        "FATAL: no pg_hba.conf entry for host "", user "postgres", database "postgres", SSL off"




        The database, from which you get the error, see a local connection, and not a networked one.



        How can it happen, it depends on your system configuration, what you didn't share here.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jun 10 '18 at 19:08









        peterhpeterh

        1,01741429




        1,01741429






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Database Administrators Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f209236%2fwhen-trying-to-connect-to-an-external-postgres-database-using-pgadmin-i-get-an%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            ف. موراي أبراهام

            صرب

            كأس إنترتوتو