R
Railway9mo ago
clinton

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.
No description
Solution:
you are missing the port variable for mysql
Jump to solution
14 Replies
Percy
Percy9mo ago
Project ID: cef25ffe-48ad-4c40-8e83-8ca4296ad84f
clinton
clintonOP9mo ago
cef25ffe-48ad-4c40-8e83-8ca4296ad84f
Brody
Brody9mo ago
in your package.json try setting your start script to sleep 3 && node index.js
clinton
clintonOP9mo ago
like this,? i set it but still cannot connect to database
No description
Brody
Brody9mo ago
show me your new deployment logs please
clinton
clintonOP9mo ago
No description
Brody
Brody9mo ago
can you connect to the database locally?
clinton
clintonOP9mo ago
yes in my local pc
Brody
Brody9mo ago
show me the code that connects to mysql please
clinton
clintonOP9mo ago
No description
Solution
Brody
Brody9mo ago
you are missing the port variable for mysql
clinton
clintonOP9mo ago
ok i will add it
clinton
clintonOP9mo ago
it works now. thanks!
No description
Brody
Brody9mo ago
no problem!
Want results from more Discord servers?
Add your server