9

I am very new to postgreSQL and struggling to create a connection in my Eclipese.

Here is what I have done till now:

  1. Installed DBeaver plugin for eclipse from marketplace.
  2. Installed PostgreSQL version 10 from https://www.postgresql.org/download/windows/

  3. Now I attempt to create a connection in Eclipse but I get an error "FATAL: password authentication failed for user "testuser"

I checked through a similar thread ( Getting authentication failed error with postgresql from command line ) but could not resolve the issue.

Could you please help.

1 Answer 1

26

To connect the PostgreSQL via Command line you have to install a PostgreSQL provided tool called "psql" if not installed already.

Then use the below command to connect to PostgreSQL database.

psql -h localhost -p 5432 -U postgres 

Explanation:

localhost: is the hostname of machine where PostgreSQL is installed.
5432 : is the default PostgreSQL port
postgres : is the username of to connect to DB

Solution for your issue:

FATAL: password authentication failed for user "testuser"

As error message specified, either user not exists on database or the password that you supplied to connect is incorrect. Re-verify your user and password, and try again.

All the best.

Sign up to request clarification or add additional context in comments.

2 Comments

psql is installed but running psql -h localhost -p 5432 -U postgres gives psql: error: could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused (0x0000274D/10061)
@heyula then you need to check your postgresql.sql file and make sure that localhost is a part of your listen_addresses. Mine works after adding it in. listen_addresses = 'localhost,10.10.1.62'

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.