title: Setup ASP.NET MVC 3 with MySQL: db of model is still SQL Server Express
body: <p>I have created a new project MVC 3.0 in VS 2010. By default the database is SQL Server Express.</p>
  
  <p>I created a basic model:</p>
  
  <pre><code>public class Movie
  {
      public int ID { get; set; }
      public String Movie { get; set; }
  }
  
  public class MovieDBContext : DbContext
  {
      public DbSet&lt;Movie&gt; Movies { get; set; }
  }
  </code></pre>
  
  <p>Now I've setup the MVC project with mysql following this <a href="https://stackoverflow.com/a/2518321">answer</a></p>
  
  <p>In the database (MySQL) some tables were created automatically (my_aspnet_applications, my_aspnet_membership, my_aspnet_profiles, my_aspnet_roles, my_aspnet_schemaversion, my_aspnet_sessioncleanup, my_aspnet_sessions, my_aspnet_users, my_aspnet_usersinroles).</p>
  
  <p>But my table <code>Movie</code> is not created. It's still in SQL Server Express. But I don't understand why is this possible, my <code>web.config</code> only has MySQL configuration:</p>
  
  <pre><code>&lt;configuration&gt;
    &lt;connectionStrings&gt;
      &lt;add name="MySqlMembershipConnection"
            connectionString="Data Source=[myserver];
                              userid=[myuser];
                              password=[mypassword];
                              database=Movies;"
            providerName="MySql.Data.MySqlClient"/&gt;
    &lt;/connectionStrings&gt;
  
    &lt;appSettings&gt;
      &lt;add key="webpages:Version" value="1.0.0.0" /&gt;
      &lt;add key="ClientValidationEnabled" value="true" /&gt;
      &lt;add key="UnobtrusiveJavaScriptEnabled" value="true" /&gt;
    &lt;/appSettings&gt;
  
    &lt;system.web&gt;
      &lt;compilation debug="true" targetFramework="4.0"&gt;
        &lt;assemblies&gt;
          &lt;add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
          &lt;add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
          &lt;add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
          &lt;add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
          &lt;add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /&gt;
        &lt;/assemblies&gt;
      &lt;/compilation&gt;
  
      &lt;membership defaultProvider="MySqlMembershipProvider"&gt;
        &lt;providers&gt;
          &lt;clear/&gt;
          &lt;add name="MySqlMembershipProvider"
               type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, 
                   Version=6.6.4.0, Culture=neutral, 
                   PublicKeyToken=c5687fc88969c44d"
               connectionStringName="MySqlMembershipConnection"
               enablePasswordRetrieval="false"
               enablePasswordReset="true"
               requiresQuestionAndAnswer="false"
               requiresUniqueEmail="true"
               passwordFormat="Hashed"
               maxInvalidPasswordAttempts="5"
               minRequiredPasswordLength="6"
               minRequiredNonalphanumericCharacters="0"
               passwordAttemptWindow="10"
               applicationName="/"
               autogenerateschema="true"/&gt;
        &lt;/providers&gt;
      &lt;/membership&gt;
  
      &lt;authentication mode="Windows" /&gt;
  
      &lt;authorization&gt;
        &lt;deny users="?" /&gt;
      &lt;/authorization&gt;
  
      &lt;profile&gt;
        &lt;providers&gt;
          &lt;clear/&gt;
          &lt;add type="MySql.Web.Security.MySQLProfileProvider, MySql.Web, 
                   Version=6.6.4.0, Culture=neutral, 
                   PublicKeyToken=c5687fc88969c44d"
               name="MySqlProfileProvider"
               applicationName="/"
               connectionStringName="MySqlMembershipConnection"
               autogenerateschema="true"/&gt;
        &lt;/providers&gt;
      &lt;/profile&gt;
  
      &lt;roleManager enabled="true" defaultProvider="MySqlRoleProvider"&gt;
        &lt;providers&gt;
          &lt;clear /&gt;
          &lt;add connectionStringName="MySqlMembershipConnection"
               applicationName="/"
               name="MySqlRoleProvider"
               type="MySql.Web.Security.MySQLRoleProvider, MySql.Web, 
                   Version=6.6.4.0, Culture=neutral, 
                   PublicKeyToken=c5687fc88969c44d"
               autogenerateschema="true"/&gt;
        &lt;/providers&gt;
      &lt;/roleManager&gt;
  
      &lt;pages&gt;
        &lt;namespaces&gt;
          &lt;add namespace="System.Web.Helpers" /&gt;
          &lt;add namespace="System.Web.Mvc" /&gt;
          &lt;add namespace="System.Web.Mvc.Ajax" /&gt;
          &lt;add namespace="System.Web.Mvc.Html" /&gt;
          &lt;add namespace="System.Web.Routing" /&gt;
          &lt;add namespace="System.Web.WebPages"/&gt;
        &lt;/namespaces&gt;
      &lt;/pages&gt;
    &lt;/system.web&gt;
  
    &lt;system.webServer&gt;
      &lt;validation validateIntegratedModeConfiguration="false"/&gt;
      &lt;modules runAllManagedModulesForAllRequests="true"/&gt;
    &lt;/system.webServer&gt;
  
    &lt;runtime&gt;
      &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" /&gt;
          &lt;bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" /&gt;
        &lt;/dependentAssembly&gt;
      &lt;/assemblyBinding&gt;
    &lt;/runtime&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Thank you very much.</p>