启动node 后端api服务时 报错:Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
mysql版本:
mysql Ver 8.0.21 for macos10.15 on x86_64 (MySQL Community Server - GPL)
解决:
-
进入mysql终端
-
重新修改密码:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
原因
node mysql 最新模块 还未完全支持 mysql 8默认的“caching_sha2_password”密码加密方式,所以我们重新用”mysql_native_password“ 的方式设置密码就好了