title: Connection string not working with MySQL
body: <p>I am creating a <code>REST API</code> using <code>MySQL DB</code> in <code>visual studio 2015 in asp.net mvc 4.5</code>. I have done each and every step which in needed to run the API using <code>MySQL</code>, but I am getting this exception.</p>
  
  <blockquote>
    <p>{"Message":"An error has occurred.","ExceptionMessage":"<strong>Format of the initialization string does not conform to specification starting at index 121.</strong>","ExceptionType":"System.ArgumentException","StackTrace":"   at System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String&amp; keyname, String&amp; keyvalue)\r\n   at System.Data.Common.DbConnectionOptions.ParseInternal(Hashtable parsetable, String connectionString, Boolean buildChain, Hashtable synonyms, Boolean firstKey)\r\n   at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Hashtable synonyms, Boolean useOdbcRules)\r\n   at System.Data.Common.DbConnectionStringBuilder.set_ConnectionString(String value)\r\n   at MySql.Data.MySqlClient.MySqlConnectionStringBuilder..ctor(String connStr)\r\n   at MySql.Data.MySqlClient.MySqlConnection.set_ConnectionString(String value)\r\n   at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.b__18(DbConnection t, DbConnectionPropertyInterceptionContext<code>1 c)\r\n   at System.Data.Entity.Infrastructure.Interception.InternalDispatcher</code>1.Dispatch[TTarget,TInterceptionContext](TTarget target, Action<code>2 operation, TInterceptionContext interceptionContext, Action</code>3 executing, Action<code>3 executed)\r\n   at System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.SetConnectionString(DbConnection connection, DbConnectionPropertyInterceptionContext</code>1 interceptionContext)\r\n   at System.Data.Entity.Internal.LazyInternalConnection.InitializeFromConnectionStringSetting(ConnectionStringSettings appConfigConnection)\r\n   at System.Data.Entity.Internal.LazyInternalConnection.TryInitializeFromAppConfig(String name, AppConfig config)\r\n   at System.Data.Entity.Internal.LazyInternalConnection.Initialize()\r\n   at System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel()\r\n   at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()\r\n   at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)\r\n   at System.Data.Entity.Internal.Linq.InternalSet<code>1.Initialize()\r\n   at System.Data.Entity.Internal.Linq.InternalSet</code>1.GetEnumerator()\r\n   at System.Data.Entity.Infrastructure.DbQuery<code>1.System.Collections.Generic.IEnumerable&lt;TResult&gt;.GetEnumerator()\r\n   at System.Collections.Generic.List</code>1..ctor(IEnumerable<code>1 collection)\r\n   at System.Linq.Enumerable.ToList[TSource](IEnumerable</code>1 source)\r\n   at RestWithMySQL.Controllers.ProductsController.Get() in D:\Work\DOT NET API\RestWithMySQL\RestWithMySQL\Controllers\ProductsController.cs:line 19"}</p>
  </blockquote>
  
  <p>I think there is a problem in my connection string. I have searched for it but couldn't find the exact solution. </p>
  
  <pre><code>&lt;connectionStrings&gt;
      &lt;!--&lt;add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-RestWithMySQL-20170911031521.mdf;Initial Catalog=aspnet-RestWithMySQL-20170911031521;Integrated Security=True" providerName="System.Data.SqlClient" /&gt;--&gt;
      &lt;add name="ProductEntities" connectionString="metadata=res://*/ProductsModel.csdl|res://*/ProductsModel.ssdl|res://*/ProductsModel.msl;provider=MySql.Data.MySqlClient;provider connection string=&amp;quot; server=localhost;user id=root;database=accurate_dev;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework" providerName="MySql.Data.MySqlClient"/&gt;
      &lt;!--&lt;remove name="LocalMySqlServer" /&gt;&lt;add name="LocalMySqlServer" connectionString="" providerName="MySql.Data.MySqlClient" /&gt;--&gt;
  &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>Any help would be highly appreciated.</p>