I am trying to connect my microservice with the CloudSQL instance via casbin-sequelize-adapter. Following is the code -
await SequelizeAdapter.newAdapter({
username: process.env.DB_USER,
password: process.env.DB_PASS,
database: process.env.DB_NAME,
dialect: 'mysql',
host: `${dbSocketPath}/${process.env.INSTANCE_CONNECTION_NAME}`,
dialectOptions: {
socketPath: `${dbSocketPath}/${process.env.INSTANCE_CONNECTION_NAME}`
},
pool: {
max: 5,
min: 0,
acquire: 30000,
idle: 10000
},
logging: false,
operatorsAliases: false
})
The error that I am getting:
code: 'ER_ACCESS_DENIED_ERROR',
errno: 1045,
sqlState: '28000',
sqlMessage: "Access denied for user 'root'@'cloudsqlproxy~35.208.115.84' (using password: YES)",
sql: undefined
What I have tried: The pasword and username contains no special characters Via CloudSQL proxy I am able to set up connection with the Cloud SQL Instance. I tried whitelisting the above IP in the Cloud SQL networks.
Can anyone suggest what can be the things that have caused this issue?