解决Code First MySql数据库 Specified key was too long; max key length is 767 bytes异常

需要给DbContext加上如下特性:

[DbConfigurationType(typeof(MySql.Data.Entity.MySqlEFConfiguration))]
    public class MyContext : DbContext
    {
        public MyContext() : base("name=MyContext") { }
        public DbSet<SyUser> SyUser { get; set; }
    }

  

posted @ 2016-03-18 16:43  魏巍(QQ:68235081)  阅读(256)  评论(0编辑  收藏  举报