Cannot connect localhost to heroku database

I am trying to get a rails application to work with heroku, but I am doing something wrong.

database.yml

   development:
    adapter: postgresql
    encoding: unicode
    database: (heroku db)
    user: (heroku db_user)
    pool: 5
    password: (heroku db_pass)

If I enter information from my heroku database, I get:

PG :: ConnectionBad FATAL: Password Authentication for the User

+4
source share
2 answers

I am not a rail guy, but this is what I did now in my spring application, I wanted to link my local development with the db hero .. I got db info from this:

heroku pg:credentials DATABASE

then I went through params .. But I found that to connect the remote db hero I needed to add this to my connection settings.

ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory
+3
source

, . , :

$ heroku config | grep HEROKU_POSTGRESQL

-

HEROKU_POSTGRESQL_RED_URL: postgres://user3123:passkja83kd8@ec2-117-21-174-214.compute-1.amazonaws.com:6212/db982398

PostgreSQL. .

:

development:
  ...
  host: ec2-117-21-174-214.compute-1.amazonaws.com
  port: 6212
  ...

, -, , .

0

Source: https://habr.com/ru/post/1532591/


All Articles