Skip to content
i cant connect MySQL service to my backend service
admin-esegames
OP

9 months ago

i have an issue where by i created an MySQL service then also created my backed services, but the main challenge now is that i cant connect my backend to use the MySQL service i juts dont know what am doing wrong

below are the credential needed my by app to run DB

DB_CONNECTION=mysql
DB_HOST=*****
DB_PORT=3306
DB_DATABASE=****
DB_USERNAME=*****
DB_PASSWORD=*****

thanks everyone

Solved$10 Bounty

Pinned Solution

You can use reference variables in your service to access MySQL credentials.

https://docs.railway.com/variables/reference#reference-variables

For example, for the host variable in your service, you would bind it to &{{MySQL.MYSQLHOST}}.

1 Reply

Status changed to Awaiting Railway Response Railway • 9 months ago


You can use reference variables in your service to access MySQL credentials.

https://docs.railway.com/variables/reference#reference-variables

For example, for the host variable in your service, you would bind it to &{{MySQL.MYSQLHOST}}.


Status changed to Solved 0x5b62656e5d • 27 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...