I'm running an AWS Lightsail linux instance with Node. I've manually installed MySQL and after some time, have connected successfully from my machine using MySql Workbench. I'm now using Node and Sequelize (local machine) to develop against this remote database. In trying to connect, I'm getting an Access Denied error in Node. Same creds as Workbench but not working.
Wondering if something looks obviously wrong here. I've rechecked the credentials as well. And the AWS instance is at a static IP, so, I'm using that as my connection URL host.
const sequelize = new Sequelize(
process.env.DB_DATABASE,
process.env.DB_USERNAME,
process.env.DB_PASSWORD,
{
host: process.env.DB_HOST, // example 25.13.15.200
dialect: "mysql",
port: 3306,
pool: {
max: 5, // max pool connections
min: 0, // mix pool connections
acquire: 30000, // max time (in ms) that pool will try to get connection before throwing an error
idle: 10000, // max time (in ms) that a connection can be idle before being released
},
operatorAliases: false,
}
);
The error I'm getting in my node server is
Checking database connection...
Unable to connect to the database
Access denied for user 'xxxxxx'@'%' to database 'xxxxxxx' // xxxxxx is to cover actual name
Starting Node / Express server on port 5000