连接字符串写错导致,修改后OK。 原来的: <connectionStrings> <add name="EFDbContext" connectionString="server=192.161.0.11;Initial Catalog=SportsStore;User ID=sa;Password=global" providerName="MySql.Data.MySqlClient "/> </connectionStrings> 修改后的: <connectionStrings> <add name="EFDbContext" connectionString="Data Source=localhost;Initial Catalog=SportsStore;;User ID=XXX;Password=XXX" providerName="MySql.Data.MySqlClient "/>
时间: 2024-11-07 14:26:31