![]() |
VOOZH | about |
dotnet add package MySqlBackup.NET --version 2.7.1
NuGet\Install-Package MySqlBackup.NET -Version 2.7.1
<PackageReference Include="MySqlBackup.NET" Version="2.7.1" />
<PackageVersion Include="MySqlBackup.NET" Version="2.7.1" />Directory.Packages.props
<PackageReference Include="MySqlBackup.NET" />Project file
paket add MySqlBackup.NET --version 2.7.1
#r "nuget: MySqlBackup.NET, 2.7.1"
#:package MySqlBackup.NET@2.7.1
#addin nuget:?package=MySqlBackup.NET&version=2.7.1Install as a Cake Addin
#tool nuget:?package=MySqlBackup.NET&version=2.7.1Install as a Cake Tool
A versatile tool for backing up and restoring MySQL databases in C#, VB.NET, and ASP.NET.
Latest Release: v2.7.1 (May 11, 2026)
Change Log
MySqlBackup.NET is a .NET library (DLL) designed to backup and restore MySQL databases. Compatible with multiple MySQL connectors—MySql.Data.DLL, MySqlConnector.DLL, and Devart.Express.MySql.DLL—it offers a programmatic alternative to tools like MySqlDump, providing greater control and flexibility in .NET environments.
Developed in C#, this library supports any .NET language (e.g., VB.NET, F#) and excels in scenarios where MySqlDump.exe or MySQL Workbench are impractical, such as web-based applications (ASP.NET) or end-user tools with simplified interfaces.
MemoryStream.INSERT, INSERT IGNORE, REPLACE, ON DUPLICATE KEY UPDATE, UPDATE.Grab the latest release from: GitHub Releases
Install via NuGet Package Manager:
MySqlConnector:
PM> Install-Package MySqlBackup.NET.MySqlConnector
https://www.nuget.org/packages/MySqlBackup.NET.MySqlConnector/
MySql.Data Connector:
PM> Install-Package MySqlBackup.NET
https://www.nuget.org/packages/MySqlBackup.NET/
Devart Express Connector:
PM> Install-Package MySqlBackup.Net.DevartExpress
https://www.nuget.org/packages/MySqlBackup.Net.DevartExpress/
See the detailed guide:
How to Add This Library into Your Project
Start by adding the appropriate using statement to your file:
// For MySqlConnector.NET (MIT)
using MySqlConnector;
// For MySQL .NET Connector by Oracle
using MySql.Data.MySqlClient;
// For dotConnect for MySQL by Devart
using Devart.Data.MySql;
string constr = "server=localhost;user=root;pwd=1234;database=test1;convertzerodatetime=true;";
string filePath = @"C:\backup.sql";
using (MySqlConnection conn = new MySqlConnection(constr))
{
using (MySqlCommand cmd = conn.CreateCommand())
{
using (MySqlBackup mb = new MySqlBackup(cmd))
{
conn.Open();
mb.ExportToFile(filePath);
}
}
}
string constr = "server=localhost;user=root;pwd=1234;database=test1;convertzerodatetime=true;";
string filePath = @"C:\backup.sql";
using (MySqlConnection conn = new MySqlConnection(constr))
{
using (MySqlCommand cmd = conn.CreateCommand())
{
using (MySqlBackup mb = new MySqlBackup(cmd))
{
conn.Open();
mb.ImportFromFile(filePath);
}
}
}
Unlike MySQL Workbench (developer-focused) or MySqlDump.exe (restricted in web environments), MySqlBackup.NET offers:
MySqlBackup.NET requires one of these MySQL connectors:
| Connector | Source | License | DLLs |
|---|---|---|---|
| MySqlConnector | MySqlConnector | MIT | MySqlConnector.dll |
| MySql.Data | MySQL Connector/Net | GPL | MySql.Data.dll |
| Devart Express | dotConnect for MySQL | Custom (FAQ) | Devart.Data.dll, Devart.Data.MySql.dll |
We aim for MySqlBackup.NET to achieve 100% SQL compliance, ensuring seamless compatibility with mysqldump and mysql.exe for both backup and restore operations. Version 2.6 introduces key improvements, addressing some flaws in previous version and compatibility challenges with mysqldump-generated files. If you encounter any incompatibilities, we welcome feedback via GitHub Issues to help us refine and uphold this goal.
utf8mb4, or utf8 in older MySQL versions that do not support utf8mb4.convertzerodatetime=true in the connection string for compatibility when handling null datetime values.For a 416 MB database (400,000 rows, 4 tables, InnoDB) on an Intel Core i7-4770S (3.10GHz, 16GB RAM, SSD Samsung 870 Evo 500GB):
👁 graph benchmark mysqlbackup.net 2025-07-04
| Task | Tool | Avg. Time | File Size |
|---|---|---|---|
| Backup | MySqlBackup.NET (Parallel) | ~10.21s | 571.588 MB |
| Backup | MySqlBackup.NET (Single) | ~15.72s | 571.588 MB |
| Backup | mysqldump.exe | ~6.76s | 566.976 MB |
| Restore | MySqlBackup.NET | ~35.87s | - |
| Restore | mysql.exe | ~32.76s | - |
MySqlBackup.NET v2.6 offers competitive performance, especially in parallel mode, with significant improvements over previous versions. Full details: Performance Benchmark Wiki.
MySqlBackup.NET is released under The Unlicense, making it free for any use.
Explore more on GitHub!
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 is compatible. |
| .NET Framework | net461 net461 was computed. net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 is compatible. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on MySqlBackup.NET:
| Package | Downloads |
|---|---|
|
Nascorp.Library
Library to methods utilities |
|
|
ThrowawayDb.MySql
Dead simple integration tests with Sql server throwaway databases. |
|
|
FrontLookCoreDbBackUpLibrary
This package adds an asp.net core database backup library! Supports MsSql And MySql. |
|
|
Senparc.Ncf.Database.MySql.Backup
Senparc.Ncf.Database.MySql.Backup |
|
|
MyDapper
Dapper的操作帮助类 |
Showing the top 3 popular GitHub repositories that depend on MySqlBackup.NET:
| Repository | Stars |
|---|---|
|
feiyit/FytSoaCms
NetCore2.2开发, Vs2017 数据Mysql
|
|
|
jaskie/PlayoutAutomation
Television broadcast automation system
|
|
|
Zaid-Ajaj/ThrowawayDb
Dead simple integration tests with SQL Server or Postgres throwaway databases that are created on the fly, used briefly then disposed of automagically.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 2.7.1 | 3,566 | 5/11/2026 |
| 2.7.0 | 3,801 | 3/21/2026 |
| 2.6.5 | 17,618 | 8/4/2025 |
| 2.6.4 | 2,263 | 7/14/2025 |
| 2.6.3 | 346 | 7/13/2025 |
| 2.6.2 | 316 | 7/11/2025 |
| 2.6.1 | 472 | 7/4/2025 |
| 2.6.0 | 387 | 7/4/2025 |
| 2.3.9 | 29,407 | 3/12/2025 |
| 2.3.8 | 167,478 | 3/7/2023 |
| 2.3.7 | 119,233 | 10/18/2022 |
| 2.3.6.1 | 169,464 | 10/20/2021 |
| 2.3.6 | 5,063 | 10/17/2021 |
| 2.3.5.3 | 4,577 | 9/24/2021 |
| 2.3.5.2 | 1,713 | 9/23/2021 |
| 2.3.5.1 | 1,806 | 9/22/2021 |
| 2.3.4.2 | 12,225 | 7/30/2021 |
| 2.3.4.1 | 6,994 | 7/12/2021 |
| 2.3.4 | 97,875 | 3/10/2021 |