[Fixed] SequelizeConnectionRefusedError: connect ECONNREFUSED


I’m using Sequelize as an ORM to my node js app and Mysql database ,
after following some tutorials i m adding this code to connect mysql to the node but after taping npm start i m getting this error :
Unable to connect to the database: { SequelizeConnectionRefusedError: connect ECONNREFUSED

 const Sequelize = require('sequelize');

 // Option 1: Passing parameters separately
 const sequelize = new Sequelize('Education', 'root','', {
 host: '',
 dialect: 'mysql'
 } );

  //test db 
.then(() => {
  console.log('Connection has been established successfully.');
 .catch(err => {
 console.error('Unable to connect to the database:', err);


Problem solved i was using port : 3307 in phpMyadmin instead of 3306

Leave a Reply

(*) Required, Your email will not be published