How to connect to a remote database in a digital ocean server

1

I have a rails application in a windows local machine and i have a postgresql remote database in digital ocean server [ubuntu server]. How to connect it, I tried like this:

database.yml

default: &default
adapter: postgresql
encoding: unicode
host: xxx.xxx.xxx.xx
username: username 
password: password
schema_search_path: "public,shared_extensions"

# For details on connection pooling, see Rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>

development:
 <<: *default
 database: database_name

When i restarted my server i get error could not connect to server: Connection timed out (0x0000274C/10060) Is the server running on host "xxx.xxx.xxx.xx" and accepting TCP/IP connections on port 5432?

am i doing the right procedure? can anyone get me through this?

ruby-on-rails
postgresql
digital-ocean

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0