Back to rankings

PomeloFoundation/Pomelo.EntityFrameworkCore.MySql

C#

Entity Framework Core provider for MySQL and MariaDB built on top of MySqlConnector

entity-frameworkdotnetdotnet-coreentity-framework-coremysqlconnectordatabasemysqlmariadbauroraorm
Star Growth
Stars
3k
Forks
415
Weekly Growth
Issues
200
1k2k
Jul 2016Nov 2019Mar 2023Jul 2026
README

Pomelo.EntityFrameworkCore.MySql

Build status Stable release feed for official builds Prerelease feed for official builds Nightly build feed for release builds Nightly build feed for debugging enabled builds

Pomelo.EntityFrameworkCore.MySql is the most popular Entity Framework Core provider for MySQL compatible databases. It supports EF Core up to its latest version and uses MySqlConnector for high-performance database server communication.

Compatibility

Dependencies

The following versions of MySqlConnector, EF Core, .NET (Core), .NET Standard and .NET Framework are compatible with published releases of Pomelo.EntityFrameworkCore.MySql:

Release Branch MySqlConnector EF Core .NET (Core) .NET Standard .NET Framework
9.0.0 main >= 2.4.0 9.0.x 8.0+ - -
8.0.3 8.0-maint >= 2.3.5 8.0.x 8.0+ - -
7.0.0 7.0-maint >= 2.2.5 7.0.x 6.0+ - -
6.0.3 6.0-maint >= 2.1.2 6.0.x 6.0+ - -
5.0.4 5.0-maint >= 1.3.13 5.0.x 3.0+ 2.1 -
3.2.7 3.2-maint >= 0.69.10 < 1.0.0 3.1.x 2.0+ 2.0 4.6.1+

Packages

Supported Database Servers and Versions

Pomelo.EntityFrameworkCore.MySql is tested against all actively maintained versions of MySQL and MariaDB. Older versions (e.g. MySQL 5.7) and other server implementations (e.g. Amazon Aurora) are usually compatible to a high degree as well, but are not tested as part of our CI. You can find a list of the versions, a release was tested against, within its release notes.

Currently tested versions are:

  • MySQL 8.4
  • MySQL 8.0
  • MariaDB 11.6
  • MariaDB 11.5
  • MariaDB 11.4 (LTS)
  • MariaDB 11.3
  • MariaDB 10.11 (LTS)
  • MariaDB 10.6 (LTS)
  • MariaDB 10.5 (LTS)

Schedule and Roadmap

Milestone Status Release Date
9.0.0 Released 2025-08-17
8.0.3 Released 2025-03-02
7.0.0 Released 2023-01-16
6.0.3 Released 2024-03-16
5.0.4 Released 2022-01-22
3.2.7 Released 2021-10-04

Nightly Builds

To use nightly builds from our Azure DevOps feed, add a NuGet.config file to your solution root with the following content and enable prereleases:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <packageSources>
        <add key="pomelo-nightly" value="https://pkgs.dev.azure.com/pomelo-efcore/Pomelo.EntityFrameworkCore.MySql/_packaging/pomelo-efcore-public/nuget/v3/index.json" />
        <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
    </packageSources>
</configuration>

Feeds

Feeds that contain optimized (Release configuration) builds:

  • https://pkgs.dev.azure.com/pomelo-efcore/Pomelo.EntityFrameworkCore.MySql/_packaging/pomelo-efcore-public/nuget/v3/index.json
  • https://www.myget.org/F/pomelo/api/v3/index.json

Feeds that contain debugging enabled unoptimized (Debug configuration) builds:

  • https://pkgs.dev.azure.com/pomelo-efcore/Pomelo.EntityFrameworkCore.MySql/_packaging/pomelo-efcore-debug/nuget/v3/index.json
  • https://www.myget.org/F/pomelo-debug/api/v3/index.json

The AZDO nupkg packages always contain .pdb files.

The MyGet nupkg packages only contain .pdb files for their debug builds. For optimized builds, the symbols are packed in a snupkg file and are available via the https://www.myget.org/F/pomelo/api/v2/symbolpackage/ symbol server URL.

All .pdb files use Source Link.

Getting Started

1. Project Configuration

Ensure that your .csproj file contains the following reference:

<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="9.0.0" />

2. Services Configuration

Add Pomelo.EntityFrameworkCore.MySql to the services configuration in your Startup.cs file of your ASP.NET Core project:

public class Startup
{
    public void ConfigureServices(IServiceCollection services)
    {
        // Replace with your connection string.
        var connectionString = "server=localhost;user=root;password=1234;database=ef";

        // Replace with your server version and type.
        // Use 'MariaDbServerVersion' for MariaDB.
        // Alternatively, use 'ServerVersion.AutoDetect(connectionString)'.
        // For common usages, see pull request #1233.
        var serverVersion = new MySqlServerVersion(new Version(8, 4, 6));

        // Replace 'YourDbContext' with the name of your own DbContext derived class.
        services.AddDbContext<YourDbContext>(
            dbContextOptions => dbContextOptions
                .UseMySql(connectionString, serverVersion)
                // The following three options help with debugging, but should
                // be changed or removed for production.
                .LogTo(Console.WriteLine, LogLevel.Information)
                .EnableSensitiveDataLogging()
                .EnableDetailedErrors()
        );
    }
}

View our Configuration Options Wiki Page for a list of common options.

3. Sample Application

Check out our Integration Tests for an example repository that includes an ASP.NET Core MVC Application.

There are also many complete and concise console application samples posted in the issue section (some of them can be found by searching for Program.cs).

4. Read the EF Core Documentation

Refer to Microsoft's EF Core Documentation for detailed instructions and examples on using EF Core.

Scaffolding / Reverse Engineering

Use the EF Core tools to execute scaffolding commands:

dotnet ef dbcontext scaffold "Server=localhost;User=root;Password=1234;Database=ef" "Pomelo.EntityFrameworkCore.MySql"

Contribute

One of the easiest ways to contribute is to report issues, participate in discussions and update the wiki docs. You can also contribute by submitting pull requests with code changes and supporting tests.

We are always looking for additional core contributors. If you got a couple of hours a week and know your way around EF Core and MySQL, give us a nudge.

License

MIT

Related repositories
jasontaylordev/CleanArchitecture

Clean Architecture Solution Template for ASP.NET Core

C#MIT Licenseclean-architecturetemplate
cleanarchitecture.jasontaylor.dev
20.3k4.2k
ent/ent

An entity framework for Go

GoGo ModulesApache License 2.0entorm
entgo.io
17.1k1k
dotnet/efcore

EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations.

C#MIT Licenseentity-frameworkdatabase
learn.microsoft.com/ef/
14.8k3.4k
SanderMertens/flecs

A fast entity component system (ECS) for C & C++

COtherecsc99
flecs.dev
8.5k608
kgrzybek/sample-dotnet-core-cqrs-api

Sample .NET Core REST API CQRS implementation with raw SQL and DDD using Clean Architecture.

C#MIT Licensedddddd-example
kamilgrzybek.com/design/simple-cqrs-implementation-with-raw-sql-and-ddd/
3.1k676
xiaonanln/goworld

Scalable Distributed Game Server Engine with Hot Swapping in Golang

GoGo ModulesApache License 2.0golangrpc
2.7k476
thepirat000/Audit.NET

An extensible framework to audit executing operations in .NET

C#MIT Licenseaudit-logaudit
learnentityframeworkcore.com/extensions/audit-entityframework-core
2.6k328
ErikEJ/EFCorePowerTools

Entity Framework Core Power Tools - reverse engineering, migrations and model visualization in Visual Studio & CLI

C#MIT Licenseentity-framework-corevisual-studio
2.5k335
zzzprojects/EntityFramework-Plus

Entity Framework Plus extends your DbContext with must-haves features: Include Filter, Auditing, Caching, Query Future, Batch Delete, Batch Update, and more

C#MIT Licensecsharpdotnet
entityframework-plus.net
2.3k318
npgsql/efcore.pg

Entity Framework Core provider for PostgreSQL

C#PostgreSQL Licenseentity-frameworknpgsql
1.8k259
genaray/Arch

A high-performance C# based Archetype & Chunks Entity Component System (ECS) with optional multithreading.

C#Apache License 2.0csharpdotnet
arch-ecs.gitbook.io/arch
1.8k172
dotnet/EntityFramework.Docs

Documentation for Entity Framework Core and Entity Framework 6

MermaidCreative Commons Attribution 4.0 Internationaldocumentationorm
learn.microsoft.com/ef/
1.7k2k