[Solved] Save error: error: connect etimedout

Problem Description:

Use nodejs to connect to the MySQL database of ECs and execute the JS file. The error is as follows:

Error: connect ETIMEDOUT
{
  errorno: 'ETIMEDOUT',
  code: 'ETIMEDOUT',
  syscall: 'connect',
  fatal: true
}

Solution:

Because the server port is not open (MySQL default port is 3306)
go to the server firewall and open the port

Read More: