MySQL Error code: ‘ER_DBACCESS_DENIED_ERROR’

  express, mysql, node.js, phpmyadmin

I am using express Node JS to connect to a MySQL database in phpMyAdmin. However, I keep getting this error:

code: ‘ER_DBACCESS_DENIED_ERROR’,
errno: 1044,
sqlMessage: "Access denied for user ‘username’@’%’ to database ‘FakeInsurance’",
sqlState: ‘42000’,
fatal: true

This is my code connecting to the database:

const db = mysql.createConnection({
    user: 'username',
    host: '[omitted IP Address]',
    password: 'password',
    database: 'FakeInsurance'
});

I’ve checked that all the permissions are set to ‘Y’. Can anyone help me out here?

Source: PHPMYADMIN

LEAVE A COMMENT