By cgmendla
I am trying to get postgres working on my droplet.
If I do a port scan for the ip of 5432, it says the port is closed. If I try to access with PGAdminIII, I get an error of ‘server doesn’t listen’
If I do a psql \conninfo I get
You are connected to database “rails” as user “rails” via socket in “/var/run/postgresql” at port “5432”.
I am able to connect with psql and create a test table
rails=> create table test (test varchar (10) );
CREATE TABLE
rails=> /dt
rails-> \d
List of relations
Schema | Name | Type | Owner
--------+------+-------+-------
public | test | table | rails
(1 row)
rails->
I think the problem could be in my database.yml. Is this the correct code for production?
production:
<<: *default
database: rails
username: rails
password: <%= ENV['APP_DATABASE_PASSWORD'] %>
I’d appreciate any help in getting pg working
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
By default PostgreSQL does not listen on your droplet’s public IPs so it is not accessible from clients on different computers. This will walk you through enabling remote connections. I would caution that if you do this you should also set up a firewall to restrict access to the now public PostgreSQL service so that only the client IPs you will be using can connect.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.