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

Created on 8 Mar 2019  路  13Comments  路  Source: sequelize/cli

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

Most helpful comment

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'

All 13 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'

@sys0pp thanks for replying. it worked with mysql 5.7

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.

so if I downgrade mysql to 5.7 that'll work ?

@Emyboy YES it does

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

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. 馃槗

That worked for me. Thank you.

Thank you for your answer.

Thank you

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'

杩欐牱鐨勮瘽淇敼浜唌ysqll鐨勫姞瀵嗘柟寮忥紝娌绘爣涓嶆不鏈紒nodejs鍔犲瘑涓嶈兘鍗囩骇鍚楋紵锛燂紵

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'

this doesnt work . i am using google cloud remote sql

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
ERROR 1221 (HY000): Incorrect usage of ALTER and SYSTEM USER

as comment above the chinese sentences means this just temporary fixes not the real solutions. is there any other solutions ?

it worked for me thank you

Was this page helpful?
0 / 5 - 0 ratings

Related issues

arndeash picture arndeash  路  3Comments

TangMonk picture TangMonk  路  3Comments

radglob picture radglob  路  6Comments

eharoldreyes picture eharoldreyes  路  3Comments

papb picture papb  路  3Comments