1、修改 Migrations/Configuration.cs 文件
 namespace DataModel.Migrations
{
using System;
using System.Data.Entity;
using System.Data.Entity.Migrations;
using System.Linq; internal sealed class Configuration : DbMigrationsConfiguration<DataModel.SpaceDataContext>
{
public Configuration()
{
12 AutomaticMigrationsEnabled = true;
13
14 AutomaticMigrationDataLossAllowed = true;
15
16 SetSqlGenerator("MySql.Data.MySqlClient", new MySql.Data.Entity.MySqlMigrationSqlGenerator()); // This will add our MySQLClient as SQL Generator
} protected override void Seed(DataModel.SpaceDataContext context)
{
// This method will be called after migrating to the latest version. // You can use the DbSet<T>.AddOrUpdate() helper extension method
// to avoid creating duplicate seed data. E.g.
//
// context.People.AddOrUpdate(
// p => p.FullName,
// new Person { FullName = "Andrew Peters" },
// new Person { FullName = "Brice Lambson" },
// new Person { FullName = "Rowan Miller" }
// );
//
}
}
}
2、修改 App.config 文件 entityFramework 节点
   <entityFramework>
<defaultConnectionFactory type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data" />
<contexts>
<context type="DataModel.SpaceDataContext,DataModel">
<databaseInitializer type="System.Data.Entity.MigrateDatabaseToLatestVersion`2[[DataModel.SpaceDataContext,DataModel], [DataModel.Migrations.Configuration,DataModel]], EntityFramework" />
</context>
</contexts>
</entityFramework>
3、完事!! 注意红色高亮处哦

  

Mysql 6.7.7 + EntityFramework 5.0 Code First 不能 Update-Database 问题的解决的更多相关文章

  1. EntityFramework 6.0< Code First > 连接 Mysql数据库(转)

    http://blog.csdn.net/kmguo/article/details/19650299 网上有很多关于用EntityFrame来连接Mysql数据库的教程,可是很多并不靠谱,转载的太多 ...

  2. EntityFramework 6.0< Code First > 连接 Mysql数据库

    网上有很多关于用EntityFrame来连接Mysql数据库的教程,可是很多并不靠谱,转载的太多了.找了很久,总算是配置好了,现在分享一下. 一,安装:     1.开发环境: VS2013与EF6 ...

  3. 转载:EntityFramework 6.0< Code First > 连接 Mysql数据库

    转载自:http://blog.csdn.net/kmguo/article/details/19650299 网上有很多关于用EntityFrame来连接Mysql数据库的教程,可是很多并不靠谱,转 ...

  4. MYSQL 1093 之You can't specify target table for update in FROM clause解决办法

    You can't specify target table for update in FROM clause含义:不能在同一表中查询的数据作为同一表的更新数据. 出现以上错误,是因为想将表自身的字 ...

  5. EntityFramework Reverse POCO Code First 生成器

    功能强大的(免费)实体框架工具 Julie Lerman 实体框架是开源的,因此开发社区可以在 entityframework.codeplex.com 上共享代码. 但是不要将自己局限在那里寻找工具 ...

  6. MySQL中文全文索引插件 mysqlcft 1.0.0 安装使用文档[原创]

    [文章+程序 作者:张宴 本文版本:v1.0 最后修改:2008.07.01 转载请注明原文链接:http://blog.zyan.cc/post/356/] MySQL在高并发连接.数据库记录数较多 ...

  7. EntityFramework 5.0 CodeFirst 教程03-数据结构的定义/列的属性

    ---------------------目录-------------------------- EntityFramework 5.0 CodeFirst 教程03-数据结构的定义/列的属性 (2 ...

  8. EntityFramework 5.0 CodeFirst 教程02-删除和修改/架构改变异常的处理

    -----------------------------------------------------目录--------------------------------------------- ...

  9. EntityFramework 5.0 CodeFirst 教程01-搭建环境和快速上手

    ----------------------------目录------------------------------ EntityFramework 5.0 CodeFirst 教程03-数据结构 ...

随机推荐

  1. VisualStudio中的编辑后期生成事件

    在visual studio中加入项目文件,也就是引用外部文件,比如在tools\options中的show directions for中选择include files,我们需要引用项目(solut ...

  2. 开心菜鸟系列学习笔记------------javascript(6)

    一.作用域链            1)函数的生命周期:            函数的生命周期分为创建和激活阶段(调用时),让我们详细研究它.            作用域链与一个执行上下文相关,变量 ...

  3. 懂说话,让冲突、尴尬时刻都bye-bye

    回忆一下自己从小到大的成长历程,你容不容易交到新朋友?在不熟悉的社交场合中,你是否也曾面临坐立难安.不知从何聊起的窘境?事实上,无论身处学校或社会,担任职务是基础或高阶,终其一生都会派上用场的能力,就 ...

  4. LeetCode_Populating Next Right Pointers in Each Node II

    Follow up for problem "Populating Next Right Pointers in Each Node". What if the given tre ...

  5. shell 脚本监控程序是否正在执行, 如果没有执行, 则自动启动该进程

    代码里面监控1个进程, 代码很简单, 我就不讲解了, 有不懂的, 可以在回复里面问. 我看见了会给予讲解. 当然了, 该脚本要执行,你需要开启系统的定时器进程 crond , 并且编辑配置文件. 执行 ...

  6. Redhat Enterprise Linux中如何关闭SELinux?

    转自http://www.cnitblog.com/lywaml/archive/2005/06/21/468.html 红帽企业 Linux 4 包括了一个 SELinux 的实现.SELinux ...

  7. MySQL数据库配置主从服务器实现双机热备

    转自:http://www.cnblogs.com/cchun/p/3712637.html 一.安装MySQL 说明:在两台MySQL服务器192.168.21.169和192.168.21.168 ...

  8. windows media player 中播放pls的方法

    windows media player目前只能播放 wpl 和 asm格式的列表文件.而linux下mplayer和vlc支持的pls,很遗憾没法支持. 不过,老外写了个“open pls in w ...

  9. if条件语句练习(相亲)

    public class a { public static void main(String[] arg){ //F是房子,Q是钱,N是能力,等于0说明没有,等于1说明有: 有一项具备则可以嫁,都不 ...

  10. pyqt labe界面超级链接例子学习

    def bz(self): self.lable1=QtGui.QLabel(u'<br><a href=http://windows.microsoft.com/zh-cn/win ...