ETIMEDOUT error only on localhost wtih same configuration

Hi Wappler Community,

I've created a new website in Node.JS and set up the database connections through the target settings, but I'm facing an issue. I have a database connection called "ConnDataSQL" configured in both the Database Manager and the Server Connect Workflows under Globals/Database Connection. The database itself is a DigitalOcean Database Cluster.

Here's the strange part: even though I made sure that the database credentials are identical for both localhost and the production server, I keep getting an ETIMEDOUT error locally. However, when I build the Docker image on the production server, everything works smoothly.

The error message I get when running a simple query on Server Connect locally is:

{
  "status": "500",
  "code": "ETIMEDOUT",
  "message": "connect ETIMEDOUT",
  "stack": "Error: connect ETIMEDOUT\n    at Connection._handleTimeoutError (/opt/node_app/node_modules/mysql2/lib/connection.js:205:17)\n    at listOnTimeout (node:internal/timers:581:17)\n    at process.processTimers (node:internal/timers:519:7)"
}

The local connection file is:

{
  "name": "ConnDataSQL",
  "module": "dbconnector",
  "action": "connect",
  "options": {
    "client": "mysql2",
    "connection": {
      "host": "private-xxxxxxxxx.b.db.ondigitalocean.com",
      "port": 25060,
      "user": "xxxx",
      "password": "xxxxxxxxxxx",
      "database": "xxxxxx",
      "ssl": {
        "ca": "/certs/ca-certificate.crt"
      }
    },
    "databaseResource": "digitalocean / august2022",
    "cloudDatabaseName": "xxxxxx"
  }
}

This configuration is identical to the one on the production server, yet I keep receiving the ETIMEDOUT error locally.

If anyone can help or has encountered a similar issue, I'd greatly appreciate any advice.

Thanks in advance!

Double check that your Digit Ocean SQL Server has opened port 25060 for external connections.

yes, thank you already done.
I can access with Navicat or even the Wappler Database Manager, but not with the connection in Globals

You are using the private network host which won’t be accessible by your localhost. Localhost needs to use the public network version for host.

Thank you @mebeingken !
The IP is the public one.

I solved in a very strange way.
I copied the connection string from Digital Ocean, so I got Custom instead of Cloud.
Then I corrected from old to new MySQL and it works.