1

I have the latest versions of PostgreSQL and its GUI-frontend, pgAdmin, installed. When I try to register a new server a fatal error appears when pgAdmin tries to connect to the newly created server - password authentication failed for user "postgres". I'm using a non-default port which was properly updated in the postgresql.conf file so I don't believe that is causing problems (restarted postgres too, as it so politely asks you to). postgres processes are running properly: picture_1

Here you can examine the configuration settings I am using to register the server: picture_2

I've tried a few passwords, including my root password but none of them appear to be working. Maybe the user has to be created separately?

This is the first time I'm encountering anything besides SQL Server or Access so please bear with me if the question and its possible solution seem far too trivial. I'm running Linux Mint 15, 32-bit. I will provided additional information, if needed of course.

2 Answers 2

4

You need to enter the password of the database user, not the OS user. The "root password" is not applicable. Do you know the password of the database user postgres?

Most systems are set up allowing peer authentication for local connections, meaning a system user can log into the database with a database user of the same name without password. localhost is not a local connection. Its privileges are determined by host entries in your pg_hba.conf file.

Since you seem to be running Postgres and pgAdmin on the same server, I suggest you try a local connection without password. Quoting the pgAdmin manual:

On Unix based systems, the address field may be left blank to use the default PostgreSQL Unix Domain Socket on the local machine, or be set to an alternate path containing a PostgreSQL socket.

Bold emphasis mine.
Of course, you have to run pgAdmin as the system user postgres for this to work.

This related answer on SO has a lot more details and links.

6
  • If I try it when leaving the password field blank it also causes an error - "Error connecting to the server: fe_sendauth: no password supplied". I've also tried disabling the "Store password" option but to no avail.
    – Venom
    Commented Jan 8, 2014 at 2:22
  • Have you tried leaving the address field blank as instructed? It is labeled "Host". Commented Jan 8, 2014 at 2:24
  • Tried it now, I receive this error - Error connecting to the server: FATAL: Peer authentication failed for user "postgres". This is getting ridiculous.
    – Venom
    Commented Jan 8, 2014 at 2:28
  • System user and database user names have to match, of course. Try running pgAdmin as system user postgres. Other than that, study the manual and set up pg_hba.conf properly. Commented Jan 8, 2014 at 2:31
  • I'll try that after a good nights sleep, thank you for your advice. I'll post an update if I manage to make it work.
    – Venom
    Commented Jan 8, 2014 at 2:36
1

Yes this type of error is faced by most user who are new to pgadmin.I have found below solution and it worked for me hope this will work for you as well.

I used below commands on my Ubuntu 12.04 LTS recently.

sudo -u postgres psql

This will ask for your system password and then you will get the PostgreSQL prompt.

and then in psql type below command to change the password.

\password

Now enter the new password and re-enter it. That's ok! then you can sign in. In this matter there is no need to change the configuration of pg_hba.conf file. After following these steps you can make new server connection registration and then make new database to continue working.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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