1

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.

  • nginx is essential to run "adminer", a database management tool
  • Since nginx and apache was running on same ports, i tried to set apache on another port, other than default port.
  • After that I restarted apache, stopped mysql, stopped nginx and also stopped node
  • I used pkill node command for stopping node service.
  • Then restarted everything but got the above error.
  • I tried many things, and finally reset everything.
  • Ever since then I am stuck on this error.

Can anyone help?

Curious Developer
  • 705
  • 3
  • 9
  • 29

1 Answers1

2

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

Community
  • 1
  • 1
Curious Developer
  • 705
  • 3
  • 9
  • 29