NodeJS连接MySQL8.0报错:
Client does not support authentication protocol requested by server; consider upgrading MySQL client
问题
此文章为备份用文章
原创:丶无殇 2023-10-07
原因
- 客户端不支持服务器请求的身份验证协议;考虑升级MySQL客户端;
- nodejs的mysql包为了兼容性并未使用最新8.0的
caching_sha2_password
加密方式
解决方法
先查询一下用户状态
mysql> alter user 'root'@'localhost' identified by '123456';
Query OK,