PostgreSQL accepting TCP/IP connections on port 5432?

Just a short post for anyone who is having this particular error,

PostgreSQL service not running
PostgreSQL service not running
Failed to connect to the database: could not connect to server:
Connection refused
Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?
could not connect to server: Connection refused. 
Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432?

We received this error when we created a new user account(KL) in Kali Linux to run as, rather than use the root account.

The reason for getting this error is that the service PostgreSQL is not running on the box. So all we have to do is to start the PostgreSQL and Metasploit services.

sudo service postgresql start; sudo service metasploit start
Start services PostgreSQL and Metasploit
sudo service postgresql start
sudo service metasploit start

To avoid having to type this in every time you reboot the box, you can just have those two services startup at boot.

Configure PostgreSQL and Metasploit to start on startup

sudo update-rc.d postgresql enable
sudo update-rc.d metasploit enable

Posted

in

by

Tags:

Comments

One response to “PostgreSQL accepting TCP/IP connections on port 5432?”

  1. borvestinkral Avatar

    Everything is very open and very clear explanation of issues. was truly information. Your website is very useful. Thanks for sharing.