The connection string 'MysqlEF' in the application's configuration file does not contain the require异常

时间:2022-01-05 22:32:04

在学习EF core first 对接mysql时,出现了这个异常.

The connection string 'MysqlEF' in the application's configuration file does not contain the require异常

原因是:连接字符串中缺少providerName="MySql.Data.MySqlClient"

    <add name="MysqlEF" connectionString="Data Source=192.168.1.125;port=3307;Database=MiniProfilerDemo;User Id=root;Password=123456;Allow User Variables=True;Convert Zero Datetime=true;" providerName="MySql.Data.MySqlClient"/>