I have done the procedures pointed out in these questions:
Entity Framework - Bank Compatibility
MySQL Connection Error asp.net MVC
I installed MySQL.Data.Entities.
My web.config looks like this:
<connectionStrings>
<add name="BancoDados" connectionString="Server=xxx;
Database=xxx;
Uid=xxx;
Pwd=xxx;"
providerName="System.Data.EntityClient"/>
</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" />
</providers>
</entityFramework>
However, running Add-Migration
triggers the following error:
Keyword not supported: 'server'.
I tried to change the providerName
to MySql.Data.MySqlClient
, triggered the following error:
The ADO.NET provider with invariant name 'MySql.Data.MySqlClient' is either not registered in the machine or application config file, or could not be loaded. See the inner exception for details.
When installing the .Net Connector error:
System.NullReferenceException: Object reference not set to an instance of an object. at MySql.Data.MySqlClient.MySqlProviderServices.GetDbProviderManifestToken (DbConnection connection at System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken (DbConnection connection at System.Data.Entity.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked (DbProviderServices providerServices, DbConnection connection) at System.Data.Entity.Infrastructure.DefaultManifestTokenResolver.