Skip to content

Not able to authenticate if tried with node-mysql2 client. It works otherwise #1318

@nvnvashisth

Description

@nvnvashisth

Hello Team,

I am try to connect mysql server with node-mysql2 from remote server. Somehow I am able to connect through mysql cli, but unfortunately can not connect through the script.

Note: Authentication plugin enabled as mysql_native_password and mysql 8.0

This I get when I try to make connection through mysql2

Can't execute Error: Access denied for user 'someuser'@'someip' (using password: YES)
    at PromisePool.query (/home/airflow-user/npmPackages/db/node_modules/mysql2/promise.js:340:22)
    at MySQL.executeAny (/home/airflow-user/npmPackages/db/src/dbs/mysql.js:46:34)
    at Object.<anonymous> (/home/airflow-user/npmPackages/db/src/dbs/mysql.js:119:29)
    at Generator.next (<anonymous>) {
  code: 'ER_ACCESS_DENIED_ERROR',
  errno: 1045,
  sqlState: '28000',
  sqlMessage: "Access denied for user 'someuser'@'someip' (using password: YES)"
}

But somehow it can login without any problem from the same remote server with below command.
mysql -h rds.amazon.com -P 3306 -u someuser -p

Any idea what could be the issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions