Using DbProviderFactories

MySqlConnector can be registered with DbProviderFactories and obtained via DbProviderFactories.GetFactory(MySqlClientFactory.InvariantName), or by using the methods described here.

.NET Framework

For .NET Framework applications, add the following section to your app.config or web.config:

     <add name="MySqlConnector"
        description="Async MySQL ADO.NET Connector"
        type="MySql.Data.MySqlClient.MySqlClientFactory, MySqlConnector, Culture=neutral, PublicKeyToken=d33d3e53aa5f8c92" />

.NET Core

For .NET Core 2.1 or later, call MySqlClientFactory.Register() during application startup. This will register MySqlConnector’s DbProviderFactory implementation in the central DbProviderFactories registry.