i can't connect to the database
The program was connect to the database and today without a reason the program crash and i can't connect to the database, in my local database connects without a problem spring:
datasource:
url: DATABASE_URL
username: postgres
password: PGPASSWORD
driver-class-name: org.postgresql.Driver
jpa:
hibernate:
ddl-auto: update
show-sql: false
properties:
hibernate:
format_sql: true
database: postgresql
database-platform: org.hibernate.dialect.PostgreSQLDialect
Solution:Jump to solution
i change the database to mysql and it's works, i don't know why, thanks for the help
24 Replies
Project ID:
N/A
are you still using a legacy database?
no, i create and a new database to try again and nothing
can i see a screenshot of your railway project please
whats the error you get in the deploy logs?
your url is the incorrect format, @aleks - please advise
i just copy paste the url that is in the postgres
aleks will need to advise further
thank you
i get and this error now
Try using
DATABASE_PRIVATE_URL
instead.
Actually, belay that
Set these environment variables:
why the thumbs downhardcoding private host and port, you know better 🤣
You can remove your custom database URL configuration, too
It always runs on 5432, and it's not like there are environment variables for that
At least, I don't think there are
there are though 😬
Please enlighten me
you new around here 🤣
PGPORT is the public port, so that won't work
oh interesting
they keep adding them, I don't check that page very often
still, though, I can't not hardcode the port
i think i added them to the page, when they added support for tcp proxys
long ago
close enough 🤣
Already try it not working
Solution
i change the database to mysql and it's works, i don't know why, thanks for the help