matteo
Im having trouble connecting my postgres db
Database Connection We are unable to connect to the database over the public network.
Can you connect using this command?
PGPASSWORD=** psql -h viaduct.proxy.rlwy.net -U postgres -p 24399 -d railway
when i run this command I get the following error:
psql: error: connection to server at "viaduct.proxy.rlwy.net" (35.212.103.87), port # failed: server closed the connection unexpectedly
I believe its an issue with how my .env variables are set up - but i can't seem to pin point where they are wrong:
My app references the following:
// Build the PostgreSQL connection string
const dbConnectionString = {
user: process.env.PGUSER '...',
password: process.env.PGPASSWORD '...',
databaseURL: process.env.DATABASE_URL '...',
host: process.env.RAILWAY_TCP_PROXY_DOMAIN '...',
port: process.env.RAILWAY_TCP_PROXY_PORT '...',
database: process.env.PGDATABASE '...',
};
pls help thanks!
30 replies