How to connect to postgresql using url

前端 未结 5 1830
予麋鹿
予麋鹿 2020-12-28 12:35

I had asked an earlier question which did not get any replies.

Basically I get an error invalid database url when I try to do heroku db:push

5条回答
  •  礼貌的吻别
    2020-12-28 12:58

    Edit your postgresql configuration (pg_hba.conf) file and change 'host' type method to 'trust'. But be aware that this is not secure.

    # TYPE  DATABASE        USER            ADDRESS                 METHOD
    
    # "local" is for Unix domain socket connections only
    local   all             all                                     trust
    # IPv4 local connections:
    host    all             all             127.0.0.1/32            trust
    # IPv6 local connections:
    host    all             all             ::1/128                 md5
    

    Restart your postgresql server and re-run the command

    $ heroku db:push postgres://postgres@localhost/myrailsdb
    

    Here is the reference to my answer: https://stackoverflow.com/a/7667344/181677

提交回复
热议问题