图文并茂解决Client does not support authentication protocol requested by server; consider upgrading MySQL

今天服务器部署node.js+mysql,调用接口报错ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client

![在这里插入图片描述]( https://img-blog.csdnimg.cn/fada9cea3721464fa06c13091d6b1bfb.png?x-oss-process=image/watermark ,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAdGFuZ2RvdTM2OTA5ODY1NQ==,size_20,color_FFFFFF,t_70,g_se,x_16#pic_center)

查了一下资料,我改了两个地方

1.配置了服务器安全组策略,新增了3306端口

![在这里插入图片描述]( https://img-blog.csdnimg.cn/f9bbef4a43134042a720fbad9115c813.png?x-oss-process=image/watermark ,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAdGFuZ2RvdTM2OTA5ODY1NQ==,size_20,color_FFFFFF,t_70,g_se,x_16#pic_center)

2.我修改mysql加密规则为普通模式,默认是严格加密模式

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的数据库密码';

操作步骤如下:然后重启node.js进行测试

![在这里插入图片描述]( https://img-blog.csdnimg.cn/e1ced8d7ba674a73b4a99e871ffa58a3.png?x-oss-process=image/watermark ,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAdGFuZ2RvdTM2OTA5ODY1NQ==,size_20,color_FFFFFF,t_70,g_se,x_16#pic_center)

大功告成~

欢迎路过的小伙伴们提出更好的方式

学无止境,合作共赢

![在这里插入图片描述]( https://img-blog.csdnimg.cn/725c97a7f64f4fe5b41620adcbb4710d.png?x-oss-process=image/watermark ,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAdGFuZ2RvdTM2OTA5ODY1NQ==,size_16,color_FFFFFF,t_70,g_se,x_16)

posted @ 2021-10-05 22:44  糖~豆豆  阅读(563)  评论(0)    收藏  举报
Live2D