项目场景:
在nest项目中使用typeorm连接MySQL时,明明配置了TypeOrmModule.forRoot(),却在运行项目时始终报错
问题描述
会提示连不上db
ERROR [TypeOrmModule] Unable to connect to the database
ERROR [ExceptionHandler] ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
原因分析:
问题在于Node(mysql)尚不支持MySQL 8的这种新的默认身份验证方法
参考: