psql: FATAL: password authentication failed for user “postgres”












0















I am running postgresql-9.6 on Rhel7. I know that the default/root user doesnt have a password, however i will like to use phpPgAdmin to do my work. the problem is I have edited my pg_hba.conf file to look as follow, (based on various documentation I have read so far:



local all all password



# IPv4 local connections:



host all all 127.0.0.1/32 password



# IPv6 local connections:



host all all ::1/128 ident



The only problem is that after this configuration even the defaul user #postgreshas completly lost access, when i try to log in as the root user with psql and and enter my computer's root user's passwordthis is this is what is what happens:



-bash-4.2$ psql
Password:
psql: FATAL: password authentication failed for user "postgres"

but when i change the above configuration on the pg_hba.conf file to:



peer



ident



ident



i can log in as root however phpPgAdmin won't let me in witouth a password. It's been 48 hours of headach. Your help is very much appricicated.










share|improve this question



























    0















    I am running postgresql-9.6 on Rhel7. I know that the default/root user doesnt have a password, however i will like to use phpPgAdmin to do my work. the problem is I have edited my pg_hba.conf file to look as follow, (based on various documentation I have read so far:



    local all all password



    # IPv4 local connections:



    host all all 127.0.0.1/32 password



    # IPv6 local connections:



    host all all ::1/128 ident



    The only problem is that after this configuration even the defaul user #postgreshas completly lost access, when i try to log in as the root user with psql and and enter my computer's root user's passwordthis is this is what is what happens:



    -bash-4.2$ psql
    Password:
    psql: FATAL: password authentication failed for user "postgres"

    but when i change the above configuration on the pg_hba.conf file to:



    peer



    ident



    ident



    i can log in as root however phpPgAdmin won't let me in witouth a password. It's been 48 hours of headach. Your help is very much appricicated.










    share|improve this question

























      0












      0








      0








      I am running postgresql-9.6 on Rhel7. I know that the default/root user doesnt have a password, however i will like to use phpPgAdmin to do my work. the problem is I have edited my pg_hba.conf file to look as follow, (based on various documentation I have read so far:



      local all all password



      # IPv4 local connections:



      host all all 127.0.0.1/32 password



      # IPv6 local connections:



      host all all ::1/128 ident



      The only problem is that after this configuration even the defaul user #postgreshas completly lost access, when i try to log in as the root user with psql and and enter my computer's root user's passwordthis is this is what is what happens:



      -bash-4.2$ psql
      Password:
      psql: FATAL: password authentication failed for user "postgres"

      but when i change the above configuration on the pg_hba.conf file to:



      peer



      ident



      ident



      i can log in as root however phpPgAdmin won't let me in witouth a password. It's been 48 hours of headach. Your help is very much appricicated.










      share|improve this question














      I am running postgresql-9.6 on Rhel7. I know that the default/root user doesnt have a password, however i will like to use phpPgAdmin to do my work. the problem is I have edited my pg_hba.conf file to look as follow, (based on various documentation I have read so far:



      local all all password



      # IPv4 local connections:



      host all all 127.0.0.1/32 password



      # IPv6 local connections:



      host all all ::1/128 ident



      The only problem is that after this configuration even the defaul user #postgreshas completly lost access, when i try to log in as the root user with psql and and enter my computer's root user's passwordthis is this is what is what happens:



      -bash-4.2$ psql
      Password:
      psql: FATAL: password authentication failed for user "postgres"

      but when i change the above configuration on the pg_hba.conf file to:



      peer



      ident



      ident



      i can log in as root however phpPgAdmin won't let me in witouth a password. It's been 48 hours of headach. Your help is very much appricicated.







      postgresql redhat centos-7 phppgadmin






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Sep 18 '18 at 0:25









      christian xchristian x

      816




      816






















          2 Answers
          2






          active

          oldest

          votes


















          0














          I was in same situation. after installation on window machine I was getting below error:



          C:Usersxxxxx>psql -U postgres

          psql: FATAL: password authentication failed for user "postgres"
          password retrieved from file "C:UsersxxxxxAppDataRoaming/postgresql/pgpass
          .conf"


          To fix the above, I edited 'pgpass.conf' file with password I was using for the 'postgres' database, and it worked.






          share|improve this answer

































            0














            This error can provide from the fact that you installed actively another version of Postgres or passively within a system update (and you may not be aware in this case).



            The consequence is that you try to connect to the current version of database that has changed (since install or update) and having in fact a port number that has changed. Therefore you may need to check this port number :



            isogladiator@edubuntu:~$ sudo /etc/init.d/postgresql status
            9.3/main (port **5432**): online
            9.5/main (port **5434**): online
            11/main (port **5433**): online


            You may be using standard port 5432 while it has become 5433 for example.






            share|improve this answer








            New contributor




            Rabah LEKHEBASSENE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.




















              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%2f217854%2fpsql-fatal-password-authentication-failed-for-user-postgres%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              0














              I was in same situation. after installation on window machine I was getting below error:



              C:Usersxxxxx>psql -U postgres

              psql: FATAL: password authentication failed for user "postgres"
              password retrieved from file "C:UsersxxxxxAppDataRoaming/postgresql/pgpass
              .conf"


              To fix the above, I edited 'pgpass.conf' file with password I was using for the 'postgres' database, and it worked.






              share|improve this answer






























                0














                I was in same situation. after installation on window machine I was getting below error:



                C:Usersxxxxx>psql -U postgres

                psql: FATAL: password authentication failed for user "postgres"
                password retrieved from file "C:UsersxxxxxAppDataRoaming/postgresql/pgpass
                .conf"


                To fix the above, I edited 'pgpass.conf' file with password I was using for the 'postgres' database, and it worked.






                share|improve this answer




























                  0












                  0








                  0







                  I was in same situation. after installation on window machine I was getting below error:



                  C:Usersxxxxx>psql -U postgres

                  psql: FATAL: password authentication failed for user "postgres"
                  password retrieved from file "C:UsersxxxxxAppDataRoaming/postgresql/pgpass
                  .conf"


                  To fix the above, I edited 'pgpass.conf' file with password I was using for the 'postgres' database, and it worked.






                  share|improve this answer















                  I was in same situation. after installation on window machine I was getting below error:



                  C:Usersxxxxx>psql -U postgres

                  psql: FATAL: password authentication failed for user "postgres"
                  password retrieved from file "C:UsersxxxxxAppDataRoaming/postgresql/pgpass
                  .conf"


                  To fix the above, I edited 'pgpass.conf' file with password I was using for the 'postgres' database, and it worked.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Oct 6 '18 at 22:06









                  peterh

                  1,02841429




                  1,02841429










                  answered Oct 6 '18 at 10:20









                  Bhupinder YadavBhupinder Yadav

                  11




                  11

























                      0














                      This error can provide from the fact that you installed actively another version of Postgres or passively within a system update (and you may not be aware in this case).



                      The consequence is that you try to connect to the current version of database that has changed (since install or update) and having in fact a port number that has changed. Therefore you may need to check this port number :



                      isogladiator@edubuntu:~$ sudo /etc/init.d/postgresql status
                      9.3/main (port **5432**): online
                      9.5/main (port **5434**): online
                      11/main (port **5433**): online


                      You may be using standard port 5432 while it has become 5433 for example.






                      share|improve this answer








                      New contributor




                      Rabah LEKHEBASSENE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.

























                        0














                        This error can provide from the fact that you installed actively another version of Postgres or passively within a system update (and you may not be aware in this case).



                        The consequence is that you try to connect to the current version of database that has changed (since install or update) and having in fact a port number that has changed. Therefore you may need to check this port number :



                        isogladiator@edubuntu:~$ sudo /etc/init.d/postgresql status
                        9.3/main (port **5432**): online
                        9.5/main (port **5434**): online
                        11/main (port **5433**): online


                        You may be using standard port 5432 while it has become 5433 for example.






                        share|improve this answer








                        New contributor




                        Rabah LEKHEBASSENE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.























                          0












                          0








                          0







                          This error can provide from the fact that you installed actively another version of Postgres or passively within a system update (and you may not be aware in this case).



                          The consequence is that you try to connect to the current version of database that has changed (since install or update) and having in fact a port number that has changed. Therefore you may need to check this port number :



                          isogladiator@edubuntu:~$ sudo /etc/init.d/postgresql status
                          9.3/main (port **5432**): online
                          9.5/main (port **5434**): online
                          11/main (port **5433**): online


                          You may be using standard port 5432 while it has become 5433 for example.






                          share|improve this answer








                          New contributor




                          Rabah LEKHEBASSENE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.










                          This error can provide from the fact that you installed actively another version of Postgres or passively within a system update (and you may not be aware in this case).



                          The consequence is that you try to connect to the current version of database that has changed (since install or update) and having in fact a port number that has changed. Therefore you may need to check this port number :



                          isogladiator@edubuntu:~$ sudo /etc/init.d/postgresql status
                          9.3/main (port **5432**): online
                          9.5/main (port **5434**): online
                          11/main (port **5433**): online


                          You may be using standard port 5432 while it has become 5433 for example.







                          share|improve this answer








                          New contributor




                          Rabah LEKHEBASSENE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          share|improve this answer



                          share|improve this answer






                          New contributor




                          Rabah LEKHEBASSENE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          answered 16 mins ago









                          Rabah LEKHEBASSENERabah LEKHEBASSENE

                          1




                          1




                          New contributor




                          Rabah LEKHEBASSENE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.





                          New contributor





                          Rabah LEKHEBASSENE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






                          Rabah LEKHEBASSENE is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






























                              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%2f217854%2fpsql-fatal-password-authentication-failed-for-user-postgres%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

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

                              صرب

                              كأس إنترتوتو