10

I'm having trouble connecting to the database for my Rails app using pgAdmin. I have the server running and I believe that my server properties are correct in pgAdmin. Here's what I have in pgAdmin server properties:

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 the server: server closed the connection unexpectedly. This probably means the server terminated abnormally before or while processing the request.

But there are no errors on my server. It appears to be running fine. Can't figure out what I'm doing wrong here.

2 Answers 2

4

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

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

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

Comments

4

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

2 Comments

Thanks for the comment Danny, I tried using 127.0.0.1 instead of localhost and that did not work either.
host: 127.0.0.1 instead of localhost worked for me on my mac. Thanks a lot for this tip!

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.