title: Entity Framework to MySql connection failed to database
body: <p>I am getting below error while connection to mysql database using Entity Framework 6</p>
  
  <blockquote>
    <p>An error occurred accessing the database. This usually means that the
    connection to the database failed. Check that the connection string is
    correct and that the appropriate DbContext constructor is being used
    to specify it or find it in the application's config file.</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>public class TestDbContext : DbContext
  {
      public TestDbContext()
         : base("name="mysqldb")
      {
  
      }
      public DbSet&lt;holidays&gt; holidays { get; set; }
  }
  
  
  &lt;configSections&gt;
  &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /&gt;   &lt;/configSections&gt;
  
  &lt;connectionStrings&gt;
  &lt;add name="mysqldb" providerName="MySql.Data.MySqlClient" connectionString="server=localhost;userid=root;password=admin;database=bobdata;/&gt; &lt;/connectionStrings&gt;
  
  &lt;entityFramework&gt;
      &lt;defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" /&gt;
      &lt;providers&gt;
        &lt;provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /&gt;
      &lt;provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.10.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"&gt;&lt;/provider&gt;
      &lt;/providers&gt;
    &lt;/entityFramework&gt;
  </code></pre>
  
  <p>In inner exception below message given</p>
  
  <blockquote>
    <p>{"Attempt by method
    'MySql.Data.MySqlClient.MySqlProviderServices.GetDbProviderManifestToken(System.Data.Common.DbConnection)'
    to access method
    'MySql.Data.MySqlClient.MySqlConnection.get_Settings()' failed."}</p>
  </blockquote>