Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting to Rails app Postgres DB using pgAdmin

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.

like image 432
Lee McAlilly Avatar asked Feb 22 '11 15:02

Lee McAlilly


People also ask

How do I connect to a Postgres database in pgAdmin?

Specify the “Port” as “5432”. Enter the name of the database in the “Database Maintenance” field. Enter your username as postgres and password (use the same password you used when previously configuring the server to accept remote connections) for the database. Click “Save” to apply the configuration.


1 Answers

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.

like image 162
bwvoss Avatar answered Nov 02 '22 23:11

bwvoss