1, first need to download the installation. NET MySQL Driver
as follows: http://dev.mysql.com/downloads/connector/net/
2. Configure Web. config
EF6:
Configuring Link strings
<connectionStrings> <add name= "SqlData" connectionstring= "server= address; Character Set=utf8; User id= username; password= password; Persist Security info=true;database= database name "providername=" MySql.Data.MySqlClient "/></connectionstrings>
Configuration driver
<system.data> <DbProviderFactories> <remove invariant= "MySql.Data.MySqlClient" ></ remove><!--Prevention Machine.config has been configured mysql.data.mysqlclient--> <add name= "MySQL Data Provider" Invariant= "MySql.Data.MySqlClient" description= ". Net Framework Data Provider for MySql" type= " MySql.Data.MySqlClient.MySqlClientFactory, Mysql.data, version=6.9.5.0, Culture=neutral, publickeytoken= C5687fc88969c44d "/> </DbProviderFactories></system.data>
Configuring the EF6 Driver
<entityFramework>
<providers> <provider invariantname= "MySql.Data.MySqlClient" type= " MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6 "/> </providers>
</entityFramework>
EF4.1:
Configuring Link strings
<connectionStrings> <add name= "SqlData" connectionstring= "server= address; Character Set=utf8; User id= username; password= password; Persist Security info=true;database= database name "providername=" MySql.Data.MySqlClient "/></connectionstrings>
Configuration driver
<system.data> <DbProviderFactories> <remove invariant= "MySql.Data.MySqlClient" ></ remove><!--Prevention Machine.config has been configured mysql.data.mysqlclient--> <add name= "MySQL Data Provider" Invariant= "MySql.Data.MySqlClient" description= ". Net Framework Data Provider for MySql" type= " MySql.Data.MySqlClient.MySqlClientFactory, Mysql.data, version=6.9.5.0, Culture=neutral, publickeytoken= C5687fc88969c44d "/> </DbProviderFactories></system.data>
You can use MySQL after configuring this !
EF4 Code First and EF6 code first link MySQL method