0

I am creating a project using Spring Boot in IntelliJ Idea. I want to use PostgreSQL as a database for my project. But I get an error that"Connection refused check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections"

  1. For postgreSQL integration into my project, I updated my "application.properties" file as shown below:

application.properties

  1. Then I created a file named data.sql and created my issue table in it:

data.sql

3. My database properties:

Data sources and drivers

4. My postgresql.conf file:

postgresql.cong

5. My hba.conf file:

pg_hba.conf

6. The error that I get:

error

Can you please help me to fix this issue ?

1 Answer 1

1

Did you restart PostgreSQL after changing the port number? If not, you'll need to do that.

If you've restarted PostgreSQL and the connection is still rejected, it may not have been able to bind to the port in question. Check the PostgreSQL log file for clues.

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

1 Comment

Thank you. I deleted PostgreSQL 13 and uploaded 12 version. It fixed.

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.