Question
Cannot connect to database with node.js
Urgent need please help me out with the issue I am getting the below error when trying to connect my node.js with database
I am getting the below error when trying to connect my node.js with database, its working fine with the local database but when connecting to digital ocean database getting the below error can anyone please help me out..
Unable to connect to the database: ConnectionError [SequelizeConnectionError]: connect ETIMEDOUT
at ConnectionManager.connect (C:\Users\Gorthy\Desktop\log-reader\log-reader\node_modules\sequelize\lib\dialects\mysql\connection-manager.js:126:17)
at processTicksAndRejections (internal/process/task_queues.js:97:5) {
parent: Error: connect ETIMEDOUT
at Connection._handleTimeoutError (C:\Users\Gorthy\Desktop\log-reader\log-reader\node_modules\mysql2\lib\connection.js:178:17)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7) {
errorno: 'ETIMEDOUT',
code: 'ETIMEDOUT',
syscall: 'connect',
fatal: true
},
original: Error: connect ETIMEDOUT
at Connection._handleTimeoutError (C:\Users\Gorthy\Desktop\log-reader\log-reader\node_modules\mysql2\lib\connection.js:178:17)
at listOnTimeout (internal/timers.js:549:17)
at processTimers (internal/timers.js:492:7) {
errorno: 'ETIMEDOUT',
code: 'ETIMEDOUT',
syscall: 'connect',
fatal: true
}
}
(node:13788) UnhandledPromiseRejectionWarning: SequelizeConnectionError: connect ETIMEDOUT
at ConnectionManager.connect (C:\Users\Gorthy\Desktop\log-reader\log-reader\node_modules\sequelize\lib\dialects\mysql\connection-manager.js:126:17)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:13788) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:13788) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
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.
×