title: C# + MySql + Code First: Format of the initialization string does not conform to specification starting at index 0
body: <p>I have created a Library Project to connect with MySQL DB.</p>
  
  <ol>
  <li>Including <code>MySql.Data</code>, <code>MySql.Data.Entity.EF6</code> by Nuget => OK.</li>
  <li>Installed <code>EntityFramework</code> by Nuget => OK</li>
  <li>I created a <code>MyContext.cs</code>:</li>
  </ol>
  
  <blockquote>
  <pre><code>namespace Project_Core.DAL.Context
  {
      [DbConfigurationType(typeof(MySqlEFConfiguration))]
      public class MyContext: DbContext
      {
          public MyContext()
              : base("myDbContext")
          {
  
          }
  
          public DbSet&lt;Staff&gt; Staffs { get; set; }
  
          protected override void OnModelCreating(DbModelBuilder modelBuilder)
          {
              modelBuilder.Conventions.Remove&lt;PluralizingTableNameConvention&gt;();
          }
      }
  }
  </code></pre>
  </blockquote>
  
  <ol start="4">
  <li>I edited the <code>App.config</code>:</li>
  </ol>
  
  <p><code>&lt;connectionStrings&gt;
  &lt;add name="myDbContext" providerName="MySql.Data.MySqlClient" connectionString="Data Source=localhost; port=3306; Initial Catalog=dbtest; uid=root; pwd=1234;" /&gt;
  &lt;/connectionStrings&gt;</code></p>
  
  <ol start="5">
  <li>I opened "Package Manager Console" and wrote:</li>
  </ol>
  
  <p><code>Enable-Migrations -Force</code></p>
  
  <p>but I got these errors:</p>
  
  <pre><code>Checking if the context targets an existing database...
  System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.
     at System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String&amp; keyname, String&amp; keyvalue)
     at System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey)
     at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules)
     at System.Data.Common.DbConnectionStringBuilder.set_ConnectionString(String value)
     at MySql.Data.MySqlClient.MySqlConnectionStringBuilder..ctor(String connStr)
     at MySql.Data.MySqlClient.MySqlConnection.set_ConnectionString(String value)
     at MySql.Data.MySqlClient.MySqlConnection..ctor(String connectionString)
     at MySql.Data.Entity.MySqlConnectionFactory.CreateConnection(String connectionString)
     at System.Data.Entity.Internal.LazyInternalConnection.Initialize()
     at System.Data.Entity.Internal.LazyInternalConnection.get_Connection()
     at System.Data.Entity.Internal.LazyInternalContext.get_Connection()
     at System.Data.Entity.Infrastructure.DbContextInfo..ctor(Type contextType, DbProviderInfo modelProviderInfo, AppConfig config, DbConnectionInfo connectionInfo)
     at System.Data.Entity.Migrations.DbMigrator..ctor(DbMigrationsConfiguration configuration, DbContext usersContext)
     at System.Data.Entity.Migrations.DbMigrator..ctor(DbMigrationsConfiguration configuration)
     at System.Data.Entity.Migrations.Design.MigrationScaffolder..ctor(DbMigrationsConfiguration migrationsConfiguration)
     at System.Data.Entity.Migrations.Design.ToolingFacade.ScaffoldRunner.Run()
     at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
     at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
     at System.Data.Entity.Migrations.Design.ToolingFacade.Run(BaseRunner runner)
     at System.Data.Entity.Migrations.Design.ToolingFacade.ScaffoldInitialCreate(String language, String rootNamespace)
     at System.Data.Entity.Migrations.EnableMigrationsCommand.&lt;&gt;c__DisplayClass2.&lt;.ctor&gt;b__0()
     at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
  Format of the initialization string does not conform to specification starting at index 0.
  </code></pre>
  
  <p>Help me solve it, thank you!</p>