NodeJS MySQL客户端不支持身份验证协议

当我尝试与mysql 8.0连接时,出现此错误.我怎样才能解决这个问题 ?

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

解决方法:

尝试如下更改密码:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'your new password'; 
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your new password';
上一篇:nginx常用配置


下一篇:java-Spring:可以有两个上下文-网络和后端吗?