0

I have struggled with this for a few days and cannot figure out what is wrong.

I am using:

-node.js 0.10.4  
-mysql 5.5.29  
-node mysql 2.0.0.alpha7  
-node sequelize 1.6.0  

When I try to execute any queries, I get an error message with ENOENT somewhere in it. From my research it seems like that is a generic node error message for a filesystem issue like a file not existing or insufficient permissions. I have checked and my credentials are correct. So, my create statements fail and then when my app goes to query the database, no tables exist and I get something like:

Error: connect ENOENT
at errnoException (net.js:883:11)
at Object.afterConnect [as oncomplete] (net.js:874:19)
--------------------
at Handshake.Sequence (/home/greg/snipit/node_modules/mysql/lib/protocol/sequences/Sequence.js:15:21)
at new Handshake (/home/greg/snipit/node_modules/mysql/lib/protocol/sequences/Handshake.js:9:12)
at Protocol.handshake (/home/greg/snipit/node_modules/mysql/lib/protocol/Protocol.js:41:50)
at Connection.connect (/home/greg/snipit/node_modules/mysql/lib/Connection.js:63:18)
at Connection._implyConnect (/home/greg/snipit/node_modules/mysql/lib/Connection.js:162:10)
at Connection.query (/home/greg/snipit/node_modules/mysql/lib/Connection.js:88:8)
at module.exports.connect (/home/greg/snipit/node_modules/sequelize/lib/dialects/mysql/connector-manager.js:247:16)
at Object.pool.Pooling.Pool.create (/home/greg/snipit/node_modules/sequelize/lib/dialects/mysql/connector-manager.js:111:19)
at dispense (/home/greg/snipit/node_modules/sequelize/node_modules/generic-pool/lib/generic-pool.js:216:17)
at Object.me.acquire (/home/greg/snipit/node_modules/sequelize/node_modules/generic-pool/lib/generic-pool.js:260:5)

What type of thing usually causes this? Thanks so much.

Marc B
  • 356,200
  • 43
  • 426
  • 500
  • Have to ask -- is MySQL running? Is it listening on the default port, 3306, or do you specify the port in the [`createConnection` options](https://github.com/felixge/node-mysql#connection-options)? If using linux/unix, is MySQL instead [using a domain socket](https://github.com/felixge/node-mysql/issues/262#issuecomment-7350986)? – Jonathan Lonowski Apr 16 '13 at 20:35
  • @JonathanLonowski Hey Jonathon thank you for your response. I checked the way I was making my connections, and it turns out I had a typo. My application reads in credentials from a json file, but I was accidentally passing the mysql password I read in to my connection as the port to connect on! So I was trying to connect at localhost:'password'. haha. This explains why half of my workers were experiencing no issue... they has no mysql password and so the connection port was defaulting. Anyways. This is of no value to anyone but me -- should I delete this question? Thanks again. – William Wettersten Apr 16 '13 at 23:35
  • 1
    No, you don't have to delete it. I'd actually say to go ahead and post the description of what you found as an answer instead of a comment -- http://blog.stackoverflow.com/2011/07/its-ok-to-ask-and-answer-your-own-questions/. It may very well prove useful to someone else who finds it later. – Jonathan Lonowski Apr 16 '13 at 23:47

1 Answers1

2

I checked the way I was making my connections, and it turns out I had a typo. My application reads in credentials from a json file, but I was accidentally passing the mysql password I read in to my connection as the port to connect on! So I was trying to connect at localhost:'password'. haha. This explains why half of my workers were experiencing no issue... they has no mysql password and so the connection port was defaulting.