Skip to content

Can't reach database server at postgres:5432 #14187

Discussion options

You must be logged in to vote

Hey @gabriel-frattini, I believe the issue here is your connection string.

DATABASE_URL="postgresql://postgres:postgres@postgres:5432/mydb?schema=public"

The format of the connection string should be:

postgresql://<USER>:<PASSWORD>@<HOST>:<PORT>/<DATABASE>?schema=<SCHEMA>

Yours is mostly correct, except the HOST shouldn't be "postgres", but instead "localhost".

DATABASE_URL="postgresql://postgres:postgres@localhost:5432/mydb?schema=public"

Replies: 17 comments 23 replies

Comment options

You must be logged in to vote
9 replies
@maxganiev
Comment options

@bablukpik
Comment options

@99lalo
Comment options

@kejlerj
Comment options

@noobpiyush
Comment options

Answer selected by vladi-stevanovic
Comment options

You must be logged in to vote
2 replies
@gmcouto
Comment options

@usmansbk
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Rormea
Comment options

@Lepaic6969
Comment options

Comment options

You must be logged in to vote
1 reply
@jziggas
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@lili21
Comment options

Comment options

You must be logged in to vote
1 reply
@solutionsSlayer
Comment options

Comment options

You must be logged in to vote
1 reply
@anasdevv
Comment options

Comment options

You must be logged in to vote
5 replies
@kelokchan
Comment options

@trishan9
Comment options

@hassanebendaoud
Comment options

@mischulz14
Comment options

@lil-id
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@slarkvan
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. team/schema Issue for team Schema.
Converted from issue

This discussion was converted from issue #14013 on July 07, 2022 09:40.