天天看點

nodejs.ER_NOT_SUPPORTED_AUTH_MODEError: ER_NOT_SUPPORTED_AUTH_MODE:

報錯:

nodejs.ER_NOT_SUPPORTED_AUTH_MODEError: ER_NOT_SUPPORTED_AUTH_MODE: 
Client does not support authentication protocol requested by server; 
consider upgrading MySQL client      

mysql版本

8.0.16

解決:

$ mysql -u root -p


> use mysql;

> alter user 'root'@'localhost' identified with mysql_native_password by '123456';

> flush privileges;      

注意:123456是連接配接資料庫的密碼

參考:

Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by serv