Not able to connect the spring boot application to sql server on railway.

jitesh-raghavHOBBY

7 months ago

I want to deploy my spring boot application so I tried setting up a MySQL server on the webiste, but I am not able to connect to it?

spring.datasource.url=jdbc:mysql://mysql.railway.internal:3306/railway
spring.datasource.username=root
spring.datasource.password= {password}
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
server.port=8085

This is my application.properties file, I have used the railway env variables.

This is the error message I am getting in console in intelij idea,

Caused by: com.mysql.cj.exceptions.CJCommunicationsException: Communications link failure, Caused by: java.net.UnknownHostException: No such host is known (mysql.railway.internal)

Can anybody help? Really pissed right now, wasted my 2 days bc

1 Replies

aditjena17FREE

a month ago

hi, did you get the fix? i am facing the same problem