首先,添加nuget

Mysql.Data     ;  Mysql.Data.Entity   ;

添加配置文件connectionStrings

<add name="conn" connectionString="Data Source=xxxxx;database=bxxxx;uid=xxxx;pwd=xxxx;" providerName="MySql.Data.MySqlClient" />

Configurations添加代码

SetSqlGenerator("MySql.Data.MySqlClient", new MySql.Data.Entity.MySqlMigrationSqlGenerator());

DataBaseContext类上面添加属性

[DbConfigurationType(typeof(MySql.Data.Entity.MySqlEFConfiguration))]

再执行migrations就可以同步代码了。

EF6使用Mysql的一些问题(code first)的更多相关文章

  1. VS2015 +EF6 连接MYSQL数据库生成实体

      VS2015 +EF6 连接MYSQL数据库生成实体   已安装软件:VS2015                       XAMPP Control Panel(Mysql服务器)      ...

  2. Entity Framework EF6使用 MySql创建数据库异常解决办法

    EF6使用MySQL数据库时,第一次创建数据库出现“Specified key was too long; max key length is 767 bytes”错误,解决办法请见以下连接. htt ...

  3. VS2013使用EF6与mysql数据库

      您的项目引用了最新实体框架:但是,找不到数据链接所需的与版本兼容的实体框架数据库 EF6使用Mysql的技巧   在vs2013中使用mysql连接entityFramework经常会遇到这个问题 ...

  4. 您的项目引用了最新实体框架;但是,找不到数据链接所需的与版本兼容的实体框架数据库 EF6使用Mysql的技巧

    转载至: http://www.cnblogs.com/Imaigne/p/4153397.html 您的项目引用了最新实体框架:但是,找不到数据链接所需的与版本兼容的实体框架数据库 EF6使用Mys ...

  5. Mysql update error: Error Code: 1175. You are using safe update mode and you tried to update a table

    Mysql update error: Error Code: 1175. You are using safe update mode and you tried to update a table ...

  6. mysql错误:Error Code: 1175. You are using safe update mode and you tried to update a table……

    今天遇到一个mysql错误:   Error Code: . You are using safe update mode and you tried to update a table withou ...

  7. [争什么! 掺在一起做撒尿牛丸啊! 笨蛋]ASP.NET Core 2.0 + EF6 + Linux +MySql混搭

    好消息!特好消息!同时使用ASP.NET Core 2.0和.NET Framework类库还能运行在linux上的方法来啦! 是的,你没有看错!ASP.NET Core 2.0,.NET Frame ...

  8. Vs2013 使用EF6 连接mysql数据库

    最近在使用MySQL数据库,在使用EF框架连接MySQL数据库时发现了一个问题,使用DB First创建实体对象的时候会出现如下图的错误:您的项目引用了最新版实体框架….. (如下图)或者会出现新建实 ...

  9. VS2017 + EF6连接MySql

    VS2017 + EF6连接MySql   原地址:https://blog.csdn.net/mzhifa/article/details/80999105 VS2017 + EF6连接MySql ...

随机推荐

  1. Installation failed with message Failed to finalize session : INSTALL_FAILED_INVALID_APK: Split lib_slice_8_apk was defined multiple times. It is possible that this issue is resolved by uninstalling a

    取消:Instant Run就行

  2. spring maven项目解决依赖jar包版本冲突方案

    引入:http://blog.csdn.net/sanzhongguren/article/details/71191290 在spring reference中提到一个解决spring jar包之间 ...

  3. 关于data-属性

    关于data-属性 现有需求如下,也就是类似做一个tab页的切换如下图: 因为这里要记录一下jquery里的“data-属性”的用法,所以忽略类似的组件. 往HTML标签上添加任意以 "da ...

  4. 我的MAXSCRIPT笔记

    getnodebyname "circle01" for o in objects do if o.name == "circle01" then select ...

  5. Java的SSH网站

    1.框架 strusts2 + Hibernate + spring 2.图片 图1-1 网站结构 图1-2 java代码结构 3.源代码 3.1 UserAction.java package co ...

  6. C6 P5.2

    引用自 http://snippetinfo.net/media/117 下载源:php-5.2-x64.zip wget 源包.zip yum -y install httpd libXpm.so. ...

  7. centos7 安装wxPython

    *** exact error that occured. This usually means GTK+ is incorrectly installed.    configure: error: ...

  8. 使用jQuery解析JSON数据-已验证

    本文来源于:http://www.cnblogs.com/codeplus/archive/2011/07/18/2109544.html 上例中得到的JSON数据如下,是一个嵌套JSON: {&qu ...

  9. TP3.1 一对多模型关联

    TP3.1.3 的一对多的模型关联 老需求 --- 一个用户多个文章,查看这些文章   HasMany 首先定义Model 模型名字叫UserMode.class.php class UserMode ...

  10. nodemon 的坑

    1. 我的系统是ubuntu18.04.2 的 在使用过程中不知道什么为题 nodemon 运行的项目不在前台打印了项目, 我监听的端口 9302 一直在运行, 前台看不到 我想停止掉用 ps -ef ...