Failed to connect to MySQL database: ETIMEDOUT connect ETIMEDOUT
Anonymous
TRIALOP

2 years ago

what is the possible reason why it failed to connect to MySQL database? I have set the variables correctly, I am sorry this is my first time deploying my work in railway.

13 Replies

Anonymous
TRIALOP

2 years ago

cef25ffe-48ad-4c40-8e83-8ca4296ad84f


brody
EMPLOYEE

2 years ago

in your package.json try setting your start script to sleep 3 && node index.js


Anonymous
TRIALOP

2 years ago

like this,? i set it but still cannot connect to database


brody
EMPLOYEE

2 years ago

show me your new deployment logs please


Anonymous
TRIALOP

2 years ago


brody
EMPLOYEE

2 years ago

can you connect to the database locally?


Anonymous
TRIALOP

2 years ago

yes in my local pc


brody
EMPLOYEE

2 years ago

show me the code that connects to mysql please


Anonymous
TRIALOP

2 years ago


brody
EMPLOYEE

2 years ago

you are missing the port variable for mysql


Anonymous
TRIALOP

2 years ago

ok i will add it


Anonymous
TRIALOP

2 years ago

it works now. thanks!


brody
EMPLOYEE

2 years ago

no problem!


Loading...