Failed to connect to MySQL database: ETIMEDOUT connect ETIMEDOUT
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.
14 Replies
Project ID:
cef25ffe-48ad-4c40-8e83-8ca4296ad84f
cef25ffe-48ad-4c40-8e83-8ca4296ad84f
in your package.json try setting your start script to
sleep 3 && node index.js
like this,? i set it but still cannot connect to database
show me your new deployment logs please
can you connect to the database locally?
yes in my local pc
show me the code that connects to mysql please
Solution
you are missing the port variable for mysql
ok i will add it
it works now. thanks!
no problem!