The Blog

ETIMEDOUT nodejs mysql

28 Feb 16

Hi man,
If you came here searching for an error like this: “Error: connect ETIMEDOUT at Connection._handleConnectTimeout” when querying a MySQL server using node, maybe you’re in the right place 🙂

Are you using node-mysql? Drop it away and switch to node-mysql2.

Why? Well, maybe there’s an explicable reason, but in my case I couldn’t find any reasonable reason 🙂

This is what I tried before switching to node-mysql2:

  • increased connection timeout on node-mysql
  • increased connection timeout on mysql server
  • several code modification without any luck

If you have other guesses, please be my guest and leave a comment!

S

Comments