Failed to connect to MySQL database: ETIMEDOUT connect ETIMEDOUT

Anonymous
TRIAL

a year 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.

0 Replies

Anonymous
TRIAL

a year ago

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


a year ago

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


Anonymous
TRIAL

a year ago

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


a year ago

show me your new deployment logs please


Anonymous
TRIAL

a year ago


a year ago

can you connect to the database locally?


Anonymous
TRIAL

a year ago

yes in my local pc


a year ago

show me the code that connects to mysql please


Anonymous
TRIAL

a year ago


a year ago

you are missing the port variable for mysql


Anonymous
TRIAL

a year ago

ok i will add it


Anonymous
TRIAL

a year ago

it works now. thanks!


a year ago

no problem!