cli: Client does not support authentication protocol requested by server; consider upgrading MySQL client

What you are doing?

Mysql authentication error shows up when i run db:migrate command.

Sequelize CLI [Node: 11.11.0, CLI: 5.4.0, ORM: 4.42.0]

Loaded configuration file "src/database/config/index.js".
Using environment "development".
sequelize deprecated String based operators are now deprecated. Please use Symbol based operators for better security, read more at http://docs.sequelizejs.com/manual/tutorial/querying.html#operators ../../node_modules/sequelize/lib/sequelize.js:242:13

ERROR: Client does not support authentication protocol requested by server; consider upgrading MySQL client

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

What do you expect to happen?

it should connect to mysql database without any error. because my code can get connected with the same configuration

What is actually happening?

it gives ERROR: Client does not support authentication protocol requested by server; consider upgrading MySQL client

Output, either JSON or SQL

Dialect: mysql __Database version: 8.0.15 __Sequelize CLI version:5.4.0 __Sequelize version:4.42.0

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15

Most upvoted comments

I believe this is an issue with MySQL 8 and not Sequelize itself.

Try running the below from MySQL Workbench and replace root witht he user you are using and password with the password that you are using.

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'

I found out that I was caused by incorrect parameters.

{ database: ‘abc’, username: undefined, password: ‘efsefs’, }

username is undefined, but the error is “consider upgrading MySQL client” So modify the user name to be true, the error resolved.

Guys, I have the same problem. The first connection requires a password authorization.

$ mysql -u root -p
# Input your mysql root password...

# Note the semicolon at the end
mysql>ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'PW';
$ npx sequelize db:migrate

Sequelize CLI [Node: 10.16.0, CLI: 5.5.0, ORM: 5.10.0]

Loaded configuration file "config/config.json".
Using environment "development".
== 20190713154523-create-user: migrating =======
== 20190713154523-create-user: migrated (0.018s)

Just update the password of the root user. It worked for me. 😓

Any update on this? Is there a way now, where we can use sequelize with the mySQL 8 using the recommended authentication - caching_sha2_password ?

I created new user into mysql server and assign all administrative roles. It worked for me.

@Emyboy YES it does