我已经挣扎了几天,无法弄清楚出了什么问题。
我正在使用:
-node.js 0.10.4
-mysql 5.5.29
-node mysql 2.0.0.alpha7
-node sequelize 1.6.0
当我尝试执行任何查询时,我在其中的某个地方收到一条错误消息ENOENT。根据我的研究,似乎这是文件系统问题的通用节点错误消息,如文件不存在或权限不足。我已经检查过,我的凭据是正确的。所以,我的创建语句失败,然后当我的应用程序去查询数据库时,没有表存在,我得到类似的东西:
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)
通常会导致什么类型的东西?非常感谢。
答案 0 :(得分:1)
我检查了我的连接方式,结果发现我有一个错字。我的应用程序从json文件中读取凭据,但我不小心将我读入的mysql密码作为连接端口传递给我的连接!所以我试图在localhost连接:'密码'。哈哈。这解释了为什么我的一半工人没有遇到任何问题...他们没有mysql密码,所以连接端口是默认的。