欢迎来到石家庄建站小程序开发公司

asp.net

“An exception has been raised that is likely due to a transient failure. Consider enabling transient

作者: 发布时间:2023-10-31 点击:

描述

使用 EFCore 去连接 mysql 数据库的时候,提示下面的报错信息:

An exception has been raised that is likely due to a transient failure.

Consider enabling transient error resiliency by

adding ‘EnableRetryOnFailure()’ to the ‘UseMySql’ call.


解决

在连接字符串中加入 sslMode=None 就可以了,代码如下:

Server=localhost;

port=3306;

Database=yourDatabase;

Uid=yourUserId;

Pwd=yourPassword;

Allow User Variables=True;

sslMode=None;


新闻资讯
相关案例