![]() |
VOOZH | about |
dotnet add package MySqlBackup.Net.DevartExpress --version 2.7.1
NuGet\Install-Package MySqlBackup.Net.DevartExpress -Version 2.7.1
<PackageReference Include="MySqlBackup.Net.DevartExpress" Version="2.7.1" />
<PackageVersion Include="MySqlBackup.Net.DevartExpress" Version="2.7.1" />Directory.Packages.props
<PackageReference Include="MySqlBackup.Net.DevartExpress" />Project file
paket add MySqlBackup.Net.DevartExpress --version 2.7.1
#r "nuget: MySqlBackup.Net.DevartExpress, 2.7.1"
#:package MySqlBackup.Net.DevartExpress@2.7.1
#addin nuget:?package=MySqlBackup.Net.DevartExpress&version=2.7.1Install as a Cake Addin
#tool nuget:?package=MySqlBackup.Net.DevartExpress&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 Framework | net45 net45 is compatible. net451 net451 was computed. net452 net452 was computed. net46 net46 was computed. net461 net461 was computed. net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 is compatible. net472 net472 was computed. net48 net48 is compatible. net481 net481 is compatible. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.7.1 | 119 | 5/11/2026 |
| 2.7.0 | 128 | 4/14/2026 |
| 2.6.5 | 349 | 8/4/2025 |
| 2.6.4 | 223 | 7/14/2025 |
| 2.6.3 | 200 | 7/13/2025 |
| 2.6.2 | 158 | 7/11/2025 |
| 2.6.1 | 166 | 7/4/2025 |
| 2.6.0 | 318 | 7/4/2025 |
| 2.3.9 | 349 | 3/12/2025 |
| 2.3.8 | 1,296 | 3/7/2023 |
| 2.3.7 | 803 | 10/18/2022 |
| 2.3.6 | 2,212 | 10/17/2021 |
| 2.3.5.1 | 687 | 9/24/2021 |
| 2.3.5 | 592 | 9/23/2021 |