Client does not support authentication protocol requested by server
宿命论是那些缺乏意志力的弱者的借口。——罗曼·罗兰
今天试了试使用js连接数据库,发现报错Client does not support authentication protocol requested by server; consider upgrading MySQL client
乍一看,代码好像没问题
| var mysql = require("mysql"); | 
但我的mysql版本是8.0.22

所以需要执行以下sql
| alter user 'root'@'localhost' identified with mysql_native_password by '789456'; | 
然后就可以正常执行了

本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 蒋立坤的博客!
 评论
Va







