0

I am trying to connect to mysql server which is hosted on a remote server on DigitalOcean

const db = new Sequelize({
    host: x.x.x.x,
    port: 3306,
    database: bar,
    username: foo,
    password: buz,
    dialect: 'mysql'
})

But I get the following error

Unhandled rejection SequelizeAccessDeniedError: Access denied for user 'foo'@'y.y.y.y' (using password: YES)

Here, in the error it shows y.y.y.y (is my Public IP Address)

Why is it defaulting to my public IP? When I mentioned x.x.x.x in the config? Am I doing something wrong here ?

darkermuffin
  • 919
  • 1
  • 7
  • 16
  • Befòre you say, hey the duplicate is for php, not node.js - the rejection comes from mysql and the programming language is not relevant in this case. – Shadow Jan 07 '18 at 08:37
  • Yes. As from the duplicate `You need to grant the permission to access the database from local` , I have solved the problem by granting access `foo@'%'` – darkermuffin Jan 07 '18 at 08:53

0 Answers0