title: Entity Framework "Specified key was too long; max key length is 1000 bytes"
body: <p>I have an application built with <code>asp.net-core 2.0</code>.</p>
  
  <p>I used <code>Pomelo.EntityFrameworkCore.MySql</code> to integrate MySql.</p>
  
  <p>The configuration which I use in Startup.cs is:</p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
      services.AddDbContext&lt;ApplicationDbContext&gt;(options =&gt; options.UseMySql("Server=localhost;port=3306;database=MyDB;user=MyDb_user;password=test123");
      ...
  }
  </code></pre>
  
  <p>The <code>DbContext</code> for <code>ApplicationUser</code> which comes with the framework looks like:</p>
  
  <pre><code>public class ApplicationDbContext : IdentityDbContext&lt;ApplicationUser&gt;
  {
      public ApplicationDbContext(DbContextOptions&lt;ApplicationDbContext&gt; options)
          : base(options)
      {
      }
  
      protected override void OnModelCreating(ModelBuilder builder)
      {
          base.OnModelCreating(builder);
          // Customize the ASP.NET Identity model and override the defaults if needed.
          // For example, you can rename the ASP.NET Identity table names and more.
          // Add your customizations after calling base.OnModelCreating(builder);
      }
  }
  </code></pre>
  
  <p>Now in MySql I created MyDB with Collation "utf8_general_ci".</p>
  
  <p>But on DB migrate I am getting the error:</p>
  
  <pre><code>'Specified key was too long; max key length is 1000 bytes'
  </code></pre>
  
  <p>All solutions which I found to get this working with utf8 doesn't work with <code>asp.net-core 2.0</code></p>
  
  <p>Is there any solution for this with <code>asp.net-core 2.0</code></p>