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.
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!
Hi there @qnptechnologies,
Are you using a DigitalOcean Managed Database cluster or did you install an SQL server on a Droplet?
If you are using a Managed Database, I would suggest making sure that you are using the correct custom Port and also that you’ve added your IP address to the trusted list so that you could connect to the database.
If you are using an SQL server installed on a Droplet, then make sure that you’ve allowed external connections as described here:
https://www.digitalocean.com/community/tutorials/how-to-allow-remote-access-to-mysql
Hope that this helps! Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.