mysqljs / mysql

A pure node.js JavaScript Client implementing the MySQL protocol.
MIT License
18.28k stars 2.52k forks source link

Connect mysql ER_ACCESS_DENIED_ERROR, but after connect through workbench, try sequelize again success! #2474

Closed grapewheel closed 3 years ago

grapewheel commented 3 years ago

Node: 14.16 sequelize: 6.5.1 mysql2: 2.2.5 mysql server: 8.0.4 docker mysql server password strategy: caching_sha2_password

Normal: I can connect to mysql throw cli, workbench, and other node module Weird: When I connect to mysql through sequelize, it always throws ER_ACCESS_DENIED_ERROR, BUT after I try workbench success, I come back try sequelize again, it was success indeed!~

It was said that if I didn't connect success throught other method, I can NOT connect it through sequelize!

sequelizeOptions: {
            database: 'repair',
            dialect: 'mysql',
            host: '127.0.0.1',
            port: 3306,
            username: 'root',
            password: 'root',
            logging: false
        },

微信截图_20210325104441

dougwilson commented 3 years ago

I think you posted this in the wrong repo, seeing as you listed mysql2 as the driver.