none
EF5 with MySql via Connector 6.7.4 RRS feed

  • Question

  • Hello, 
    im trying to use EF with MySQL(part of my final paper thats way MySql). So I download mysql-installer-web-community-5.7.1.3-m11.msi (its dev version because official gace mi constant exception when i was trying to choos what to install) and with it i installed tool for visual studio 2012. With this i generated new Data model(edmx, context etc.) from my MySql db - so far so good. 
    Then i installed via NuGet MySql.Data and MySql.Data.Entities(version 6.7.4 and 6.7.4.1) and created conn string and DbProviderFactories : 
    <connectionStrings> 
    <add name="classicmodelsEntities" connectionString="metadata=res://*/mysql.Model1.csdl|res://*/mysql.Model1.ssdl|res://*/mysql.Model1.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=localhost;user id=root;password=Password;persist security info=True;database=classicmodels&quot;" providerName="MySql.Data.MySqlClient" /> 
    </connectionStrings> 

    <DbProviderFactories> 
    <remove invariant="MySql.Data.MySqlClient" />
    <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data" /> 
    </DbProviderFactories> 

    but when i create context i got error: 
    Unable to find the requested .Net Framework Data Provider. It may not be installed 
    when i change my connstring so it will use

    providerName="System.Data.EntityClient" 
    The specified store provider cannot be found in the configuration, or is not valid 

    I tried also downloading connectormysql-connector-net-6.7.4.msi and install it but it doesnt help either. 

    I tried to register the provider with the strong name, like: 
    <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />

    but it failed also.

    Any ideas? (i went with this first on mysql official forum but the didnt help me so u guys are my last hope;))

    Wednesday, July 17, 2013 6:05 PM

Answers