question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ETIMEDOUT when trying to connect to a MySQL server.

See original GitHub issue

I’m trying to connect to my SQL server but I’m getting an ETIMEDOUT error: error connecting: Error: connect ETIMEDOUT at Connection._handleTimeoutError (C:\Users\me\Desktop\Emberlox Bot\node_modules\mysql2\lib\connection.js:169:17) at ontimeout (timers.js:436:11) at tryOnTimeout (timers.js:300:5) at listOnTimeout (timers.js:263:5) at Timer.processTimers (timers.js:223:10) Here is my code: `var mysql = require(‘mysql2’); var connection = mysql.createConnection({ host : ‘brick-city.com’, user : ‘root’, password : ‘snip’, port : 3306 });

connection.connect(function(err) { if (err) { console.error('error connecting: ’ + err.stack); return; }

console.log('connected as id ’ + connection.threadId); });`

I’m using latest node and latest mysql2

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
ahathawaycommented, Oct 1, 2019

i am having this same issue actually, my use case is a docker container on an ec2 instance, trying to connect to amazon aurora mysql RDS. I am able to shell into the container and run mysql cli to connect to the rds instance without issue, but for some reason the node app is unable to. nslookup and ping are resolving the host properly, i have tried the endpoint (hostname) as well as the private ip, both of which work at the command line. I’m using node 10LTS.

0reactions
ahathawaycommented, Oct 2, 2019

@sidorares my apologies, after some additional testing it looks like this was a configuration issue in the docker-compose file ENV values. Please consider my issue resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ETIMEDOUT error when querying mysql database
Check the err parameter in the callback to see, what went wrong. From your code I guess, the connection was closed, before the...
Read more >
[Error: connect ETIMEDOUT] · Issue #1474 · mysqljs/mysql
Hi @cashFLO960 the error Error: connect ETIMEDOUT is from the Node.js networking code. It means that a TCP connection could not be established...
Read more >
HOW can i solve the Error: connect ETIMEDOUT when try to ...
The error always states the Error: connect ETIMEDOUT… the funny thing is that i can connect the cluster with mysql client terminal and...
Read more >
Sequelize and Mysql throw connect ETIMEDOUT error
In the server I use pm2 cluster mode(8 instances) to handle all the requests. Is the first that I manage a server and...
Read more >
Run MySQL query ERROR: connect ETIMEDOUT - Questions
Are you sure that all the data is correct, especially the port? Is the MySQL server for sure reachable from n8n? Did you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found