I can't seem to be able to use the mariadb app i'm running in my PHP project
I want to be able to connect my mariadb app deployed on railway in my PHP script but when I try to use the domain i generated on railway to test it i always get an getaddrinfo failed: Host unknown error, i have been trying different things but nothing seem to work
Solution:Jump to solution
but yeah as it stands, you will only be able to connect to the database while on railway and only from the internal domain
24 Replies
Project ID:
c85ae7e7-7613-4046-984a-d794087b9f9e
c85ae7e7-7613-4046-984a-d794087b9f9e
show us a screenshot of your service variables please
The thing is I figured it out more or less, in the mariadb template I didn't have a variable for the host of the container, so I added to the project the github repo with my code and tried it with the private connection from railway, that worked but I want to know if there is a way to access it from outside the railway project it doesn't add to the usage
you can't access a database over the private network, please show me us a screenshot of your service variables, keep the values hidden
where is the database hosted
In that project, in railway
railway doesnt provide a mariadb? did you deploy your own?
I used a template, it seems to use some dockerfiles
can you connect to it with the internal domain?
I couldn't find that, only thing i found was the exposed port
the internal domain is visable in the service settings of the database service
you will not be able to connect to the database from the public railway domain, you can go ahead and remove the public domain from the service
Could you show me where the internal domain should be? I can't find it in the database settings
again, in the service settings
Oh you mean that
Thats worked when I uploaded my code into the railway project
But i couldn't access the database from outside
okay so you can connect to the database with that domain when deployed to railway
Thats correct
this is expected, railway doesn't yet support tcp proxying for services
^
Then if I want to connect to this database I need to deploy my code right?
There is no other way right now
there is, but its out of the scope of these help threads
look into ngrok
Ok, i will check that out, thx for the help
Solution
but yeah as it stands, you will only be able to connect to the database while on railway and only from the internal domain