This is an ADO.NET data
provider for MySQL. It provides implementations of
DbConnection
, DbCommand
, DbDataReader
, DbTransaction
—the classes
needed to query and update databases from managed code.
Complete documentation is available at the MySqlConnector Documentation Website.
This library implements true asynchronous I/O for database operations, without blocking
(or using Task.Run
to run synchronous methods on a background thread). This greatly
improves the throughput of a web server that performs database operations.
This library outperforms Connector/NET (MySql.Data
) on benchmarks:
(Client: MySqlConnector 0.44.0, Windows 10 x64; Server: MySQL Server 5.6.21, Unix)
This library fixes dozens of outstanding bugs in Connector/NET.
This library is MIT-licensed and may be freely distributed with commercial software. Commercial software that uses Connector/NET may have to purchase a commercial license from Oracle.
This library is compatible with popular .NET ORMs including:
- Dapper (GitHub, NuGet)
- LINQ to DB (GitHub, NuGet)
- NHibernate (GitHub, NuGet)
- NReco.Data (GitHub, NuGet)
- Paradigm ORM (GitHub, NuGet)
- RepoDb (GitHub, NuGet)
- ServiceStack.OrmLite (GitHub, NuGet)
- SimpleStack.Orm (GitHub, NuGet)
For Entity Framework support, use:
Appveyor | Azure Pipelines | NuGet |
---|---|---|
Install the latest .NET Core.
To build and run the tests, clone the repo and execute:
dotnet restore
dotnet test tests\MySqlConnector.Tests
To run the side-by-side tests, see the instructions.
The goals of this project are:
- .NET Standard support: It must run on the full .NET Framework and all platforms supported by .NET Core.
- Async: All operations must be truly asynchronous whenever possible.
- High performance: Avoid unnecessary allocations and copies when reading data.
- Lightweight: Only the core of ADO.NET is implemented, not EF or Designer types.
- Managed: Managed code only, no native code.
- Independent: This is a clean-room reimplementation of the MySQL Protocol, not based on Connector/NET.
Cloning the full API of Connector/NET is not a goal of this project, although it will try not to be gratuitously incompatible. For typical scenarios, migrating to this package should be easy.
This library is licensed under the MIT License.
If you'd like to contribute to MySqlConnector, please read our contributing guidelines.