码迷,mamicode.com
首页 > 数据库 > 详细

Entity Framework 连接MySQL数据库

时间:2016-07-20 15:02:30      阅读:248      评论:0      收藏:0      [点我收藏+]

标签:

 1 <?xml version="1.0" encoding="utf-8"?>
 2 <configuration>
 3   <configSections>
 4     <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
 5   </configSections>
 6   
 7   <connectionStrings>
 8     <add name="DefaultConnection" connectionString="server=192.168.1.251;User Id=root;password=;Persist Security Info=True;Character Set=utf8;database=yunzhi" providerName="MySql.Data.MySqlClient" />
 9   </connectionStrings>
10   
11   <entityFramework>
12     <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
13       <parameters>
14         <parameter value="mssqllocaldb" />
15       </parameters>
16     </defaultConnectionFactory>
17     <providers>
18       <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
19       <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"></provider>
20     </providers>
21   </entityFramework>
22   
23   <system.data>
24     <DbProviderFactories>
25       <remove invariant="MySql.Data.MySqlClient" />
26       <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.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
27     </DbProviderFactories>
28   </system.data>
29 </configuration>

 

Entity Framework 连接MySQL数据库

标签:

原文地址:http://www.cnblogs.com/cbread/p/5688270.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!