Curious Developer
Curious Developer

Reputation: 725

Unhandled rejection SequelizeConnectionError: connect ENOENT

I am stuck at a point. I am trying to start /connect using command "npm start" but unable to start npm on server.

I am getting this error:

Unhandled rejection SequelizeConnectionError: connect ENOENT
    at Handshake._callback (/home/ec2-user/webapps/vactivity/node/vactivity/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:63:20)
    at Handshake.Sequence.end (/home/ec2-user/webapps/vactivity/node/vactivity/node_modules/mysql/lib/protocol/sequences/Sequence.js:96:24)
    at Protocol.handleNetworkError (/home/ec2-user/webapps/vactivity/node/vactivity/node_modules/mysql/lib/protocol/Protocol.js:358:14)
    at Connection._handleNetworkError (/home/ec2-user/webapps/vactivity/node/vactivity/node_modules/mysql/lib/Connection.js:382:18)
    at Socket.emit (events.js:95:17)
    at net.js:441:14
    at process._tickCallback (node.js:442:13)

Apart from this my website work on nodejs & have nginx server configured on server.

Every thing started when I tried to set apache for adding a wordpress blog website. Since nginx already working on port 80. I was trying to set apache on another port so that everything work and ended up with above error. Now my website is not starting at all.

Edit: My website is running using nodejs. I needed a wordpress blog website to run along and so i checked if there is a scope for apache on my server. I found that apache along with nginx service was already running and mysql as well.

Can anyone help?

Upvotes: 1

Views: 12528

Answers (1)

Curious Developer
Curious Developer

Reputation: 725

I finally figured the problem and solved it.

Connect ENOENT means that system is unable to connect to mysql because its path is not correct.

As mentioned in an approved answer from Connect MySQL with Sequelize

Update your models/index.js file with the mentioned code. To find you mysql socket path go to file here /etc/mysql/my.cnf ( this path may depend on your server). For my case it was /etc/my.cnf. Here you will find the socket path. Now paste this path to the code above and do npm start.

Problem is resolved. :)

Upvotes: 2

Related Questions