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.
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.