NodeJS MySQL Client does not support authentication protocol

Rupesh picture Rupesh · Jun 24, 2018 · Viewed 22.4k times · Source

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

Answer

TIAGO SILVA picture TIAGO SILVA · Nov 25, 2018

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';