Connect to a Postgres DB Rails application using pgAdmin

I am having problems connecting to the database for my Rails application using pgAdmin. I have a server running, and I believe that my server properties are correct in pgAdmin. Here is what I have in the properties of the pgAdmin server:

Name: achievenext_dev Host: localhost port: 3000 SSL: Maintenance DB: postgres username: achievenext password: ****** Store password: true Restore env?: true DB Restriction: Service: Connect now: true 

And in my database.yml file:

 development: adapter: postgresql host: localhost username: achievenext password: ****** database: achievenext_dev 

But when I try to connect, pgAdmin returns this error:

An error has occurred:

Error connecting to server: the server unexpectedly closed the connection. This probably means that the server terminated abnormally before or during request processing.

But there are no errors on my server. It seems to be working fine. I can’t understand what I'm doing wrong here.

+7
source share
2 answers

Try adding a port to your development.yml file. Especially if you run Windows.

The default port:5432 , and I'm not sure if specifying port:3000 in your pgAdminIII will cause problems.

+3
source

Can you try using 127.0.0.1 instead of localhost? I know that mysql often causes problems that it will try to connect to the socket file instead of creating a TCP connection.

+1
source

All Articles