Description: Authentication method 'caching_sha2_password' failed. Either use a secure connection, specify the server's RSA public key with ServerRSAPublicKeyFile, or set AllowPublicKeyRetrieval=True.
SqlSugar.SqlSugarException: Authentication method 'caching_sha2_password' failed. Either use a secure connection, specify the server's RSA public key with ServerRSAPublicKeyFile, or set AllowPublicKeyRetrieval=True.
at SqlSugar.MySqlProvider.GetScalarAsync(String sql, SugarParameter[] parameters)
at SqlSugar.MySqlProvider.GetScalarAsync(String sql, SugarParameter[] parameters)
at SqlSugar.QueryableProvider`1.GetCountAsync()
at SqlSugar.QueryableProvider`1.CountAsync()
at SqlSugar.QueryableProvider`1.ToPageListAsync(Int32 pageIndex, Int32 pageSize, RefAsync`1 totalNumber)
at SqlSugar.QueryableProvider`1.ToPageListAsync(Int32 pageNumber, Int32 pageSize, RefAsync`1 totalNumber, RefAsync`1 totalPage)
解决方法
在链接数据库的字符串添加:AllowPublicKeyRetrieval=True 即可