node连接数据库报错。
Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
数据库版本
mysql --version
mysql Ver 8.0.21 for Linux on x86_64 (MySQL Community Server - GPL)
原因
mysql8.0以上加密方式,Node还不支持。
alter user 'root'@'localhost' identified with mysql_native_password by 'xxx';
登陆mysql,执行这个命令就好了。