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.
it should connect to mysql database without any error. because my code can get connected with the same configuration
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
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
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'