MYSQL:ER_NOT_SUPPORTED_AUTH_MODE:Client does not support authentication protocol
Error: ER_BAD_DB_ERROR: Unknown database 'user' at Handshake.Sequence._packetToError (/Users/apple/Desktop/githubdoc/node/server/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14) .....
node使用mysql报错。
原因:登录数据库的客户端跟mysql8.0不兼容了,mysql8.0密码认证采用了新的密码格式
解决办法:
在系统mysql终端输入下面命令
//password 是你的数据库账户密码,root和host也是 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';