Connection time out error when trying to connect Node App on app platform to a managed database?

Hey, so I’m using digital ocean for the first time and I’m working to deploy a node app on app platform and connecting to a mySQL database.

I’m having issues connecting the app to the managed database. I get this error

[2022-04-19 16:15:25] Error: connect ETIMEDOUT [2022-04-19 16:15:25] at PoolConnection._handleTimeoutError (/workspace/node_modules/mysql2/lib/connection.js:189:17) [2022-04-19 16:15:25] at listOnTimeout (internal/timers.js:554:17) [2022-04-19 16:15:25] at processTimers (internal/timers.js:497:7) { [2022-04-19 16:15:25] errorno: ‘ETIMEDOUT’, [2022-04-19 16:15:25] code: ‘ETIMEDOUT’, [2022-04-19 16:15:25] syscall: ‘connect’, [2022-04-19 16:15:25] fatal: true [2022-04-19 16:15:25] } [2022-04-19 16:15:25] Done in 13.29s.

I’ve seen that in this question:

This could be caused by the fact that a port is not opened. How can I open this on app platform?

Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
April 21, 2022


Have you defined your database details as environment variables as described here:



Eyy Efe,

Have you check out Trusted sources? (click on your app and click on the Settings tab) You could have restricted access to database cluster.

Let me know if that helps - Sergio Turpín