2

I start recently in the express and I want to connect my express with MySQL. But every time I made a request on postman I have this error. The database, table, and content are created and I can use them on the terminal. Can someone help me??

[nodemon] starting `node index.js`
Express server is running

Error: connect ETIMEDOUT
    at PromiseConnection.query (/Users/xxxx/xxxxx/api-express-lesson/node_modules/mysql2/promise.js:93:22)
    at /Users/xxx/xxxxx/api-express-lesson/index.js:56:6 {
  code: 'ETIMEDOUT',
  errno: undefined,
  sql: undefined,
  sqlState: undefined,
  sqlMessage: undefined
}

Sometimes I also have this error..

error connecting to db Error: connect ETIMEDOUT
    at Connection._handleTimeoutError (/Users/xxxxxx/api-express-lesson/node_modules/mysql2/lib/connection.js:189:17)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7) {
  errorno: 'ETIMEDOUT',
  code: 'ETIMEDOUT',
  syscall: 'connect',
  fatal: true
}

0 Answers0