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

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

