Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NodeJS MySQL Client does not support authentication protocol

When I am trying to connect with mysql 8.0 I am getting this error. How can I fix this ?

code: 'ER_NOT_SUPPORTED_AUTH_MODE',
errno: 1251,
sqlMessage: 'Client does not support authentication protocol requested by server; 
consider upgrading MySQL client',
sqlState: '08004',
fatal: true
like image 610
Rupesh Avatar asked Jun 24 '18 09:06

Rupesh


People also ask

How do I fix error code 1251 in MySQL?

I searched on MySQL documentation and I found this: ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; And this worked!


2 Answers

Try change the password as below:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'your new password'; 
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your new password';
like image 196
TIAGO SILVA Avatar answered Nov 02 '22 20:11

TIAGO SILVA


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

FLUSH PRIVILEGES;

"password" is that you have to change the password you already have or you will modify it for a new one

like image 22
AN German Avatar answered Nov 02 '22 20:11

AN German