MySQL连接字符串:
<connectionStrings> <add name="cdalcontext" connectionString="server=localhost;user id=root;password=123456;database=day1201" providerName="MySql.Data.MySqlClient" /> </connectionStrings>
安装包:
和
[DbConfigurationType(typeof(MySql.Data.Entity.MySqlEFConfiguration))] //表示选用MySQL的包,默认是sql server
跨域文件不变。