0

Installed via NuGet: MySql.Data, MySql.Data.Entities, MySql.Data.Entity.

Web.config:

<connectionStrings>
  <add name="WhateverEntities" providerName="MySql.Data.MySqlClient" connectionString="server=127.0.0.1;port=3306;database=dbname;uid=root;password=pass" />
<connectionStrings>

...

<entityFramework>
  <defaultConnectionFactory type="MySql.Data.Entity.MySqlConnectionFactory, MySql.Data.Entity.EF6" />
    <providers>
      <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6, Version=6.9.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
    </providers>
<entityFramework>

ApplicationDbContext.cs:

public ApplicationDbContext() : base(nameOrConnectionString: "WhateverEntities") {}

tried to add:

[DbConfigurationType(typeof(MySql.Data.Entity.MySqlEFConfiguration))]

and:

[DbConfigurationType(typeof(MySqlEFConfiguration))]

got this error:

An exception of type 'System.Data.Entity.Core.ProviderIncompatibleException' occurred in EntityFramework.dll but was not handled in user code

Additional information: The provider did not return a ProviderManifestToken string.

What's wrong?

Tomo
  • 429
  • 1
  • 10
  • 24
  • possible duplicate of [EF 4.1 exception "The provider did not return a ProviderManifestToken string"](http://stackoverflow.com/questions/5423278/ef-4-1-exception-the-provider-did-not-return-a-providermanifesttoken-string) – vdwijngaert Apr 23 '15 at 19:21
  • @vdwijngaert: I checked that before and changed my password in config.inc.php (Xampp) with no success. – Tomo Apr 23 '15 at 19:31
  • What does PHP and Apache have to do with this? You're running a windows server. – vdwijngaert Apr 23 '15 at 19:34
  • I'm trying to connect to a MySql database on localhost powered by Xampp. – Tomo Apr 23 '15 at 19:51
  • Config.inc.php is probably your phpmyadmin configuration file. You can't change your mysql password in there. Verify your username and password using the commandline application, or using phpmyadmin. – vdwijngaert Apr 23 '15 at 19:53
  • I did: http://stackoverflow.com/a/20796340/4427688 . I will try your suggestion. – Tomo Apr 23 '15 at 20:03
  • I changed the password in PhpMyAdmin as well and works like a charm. It was easy in the end, but I lost several hours with it. Thank you. – Tomo Apr 23 '15 at 20:55

1 Answers1

1

It was a matter of password as vdwijngaert suggested. Changed it in PhpMyAdmin.

Tomo
  • 429
  • 1
  • 10
  • 24