MySQL Connector/NET functionality is available as packages from NuGet, an open-source package manager for the Microsoft development platform (including .NET Core). The NuGet Gallery is the central software package repository populated with the most recent NuGet packages for Connector/NET.
You can install or upgrade one or more individual Connector/NET packages with NuGet, making it a convenient way to introduce existing technology, such as Entity Framework, to your project. NuGet manages dependencies across the related packages and all of the prerequisites are listed in the NuGet Gallery. For a description of each Connector/NET package, seeConnector/NET Packages (NuGet).
For projects that require Connector/NET assemblies to be stored in the GAC or integration with Entity Framework Designer (Visual Studio), use thestandalone MSI to install Connector/NET, rather than installing the NuGet packages.
The NuGet Gallery (https://www.nuget.org/) provides several client tools that can help you install or upgrade Connector/NET packages. If you are not familiar with the tool options or processes, seePackage consumption workflow to get started. After locating a package description in NuGet, confirm the following information:
The identity and version number of the package are correct. Use theVersion History list to select the current version.
All of the prerequisites are installed. See theDependencies list for details.
The license terms are met. See theLicense Info link to view this information.
Connector/NET provides the following five NuGet packages:
MySql.DataThis package contains the core functionality of Connector/NET, including using MySQL as a document store (with Connector/NET 8.0 only). It implements the required ADO.NET interfaces and integrates with ADO.NET-aware tools. In addition, the packages provides access to multiple versions of MySQL server and encapsulates database-specific protocols.
MySql.WebThe
MySql.Webpackage includes support for the ASP.NET 2.0 provider model (seeSection 6.2, “ASP.NET Provider Model and Tutorials”). This model enables you to focus on the business logic of your application, rather than having to recreate boilerplate items such as membership and roles support. The package supports the membership, role, profile, and session-state providers.Package dependency:
MySql.Data.MySql.Data.EntityFrameworkThis package provides object-relational mapper (ORM) capabilities, which enables you to work with MySQL databases using domain-specific objects, thereby eliminating the need for most of the data access code. Select this package for your Entity Framework 6 applications (seeSection 7.1, “Entity Framework 6 Support”).
Package dependency:
MySql.Data.MySql.Data.EntityFrameworkCoreThis package is similar to the
MySql.Data.EntityFrameworkpackage; however, it provides multi-platform support for Entity Framework tasks. Select this package for your Entity Framework Core applications (seeSection 7.2, “Entity Framework Core Support”).MySql.Data.EntityFrameworkCore.DesignThe
MySql.Data.EntityFrameworkCore.Designpackage includes shared design-time components for Entity Framework Core tools, which enable you to scaffold and migrate MySQL databases.NoteBeginning with Connector/NET 8.0.20, the functionality provided in this package has been relocated to the
MySql.Data.EntityFrameworkCorepackage. The originalMySql.Data.EntityFrameworkCore.Designpackage is deprecated.