nodejs:v12.16.2
mysql:8.0
错误信息:query error:Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
原因:node-mysql 模块不支持mysql的加密方式
处理方式:
1、mysql -u root -p;
2、use mysql;
3、select user,host from user;
4、ALTER USER '这里是用户名user'@'这里是主机host' IDENTIFIED WITH mysql_native_password BY '这里是登录密码';