MySqlBackup.NET.MySqlConnector
2.6.0
See the version list below for details.
dotnet add package MySqlBackup.NET.MySqlConnector --version 2.6.0
NuGet\Install-Package MySqlBackup.NET.MySqlConnector -Version 2.6.0
<PackageReference Include="MySqlBackup.NET.MySqlConnector" Version="2.6.0" />
<PackageVersion Include="MySqlBackup.NET.MySqlConnector" Version="2.6.0" />
<PackageReference Include="MySqlBackup.NET.MySqlConnector" />
paket add MySqlBackup.NET.MySqlConnector --version 2.6.0
#r "nuget: MySqlBackup.NET.MySqlConnector, 2.6.0"
#:package MySqlBackup.NET.MySqlConnector@2.6.0
#addin nuget:?package=MySqlBackup.NET.MySqlConnector&version=2.6.0
#tool nuget:?package=MySqlBackup.NET.MySqlConnector&version=2.6.0
MySqlBackup.NET
A versatile tool for backing up and restoring MySQL databases in C#, VB.NET, and ASP.NET.
Latest Release: v2.6 (July 04, 2025)
Change Log
Overview
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.
Key Features
- Backup and restore MySQL databases programmatically.
- Supports all .NET languages.
- Export/import via files or
MemoryStream
. - Conditional row exports (filter tables/rows).
- Progress reporting for export and import tasks.
- Flexible row export modes:
INSERT
,INSERT IGNORE
,REPLACE
,ON DUPLICATE KEY UPDATE
,UPDATE
. - Ideal for ASP.NET and web service integration.
Getting Started
Installation
Download
Grab the latest release from: GitHub Releases
NuGet Packages
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/
Add to Your Project
See the detailed guide:
How to Add This Library into Your Project
Basic Usage
Backup a Database
string constr = "server=localhost;user=root;pwd=1234;database=test1;convertzerodatetime=true;";
string filePath = @"C:\backup.sql";
using (var conn = new MySqlConnection(constr))
using (var cmd = conn.CreateCommand())
using (var mb = new MySqlBackup(cmd))
{
conn.Open();
mb.ExportToFile(filePath);
}
Restore a Database
string constr = "server=localhost;user=root;pwd=1234;database=test1;convertzerodatetime=true;";
string filePath = @"C:\backup.sql";
using (var conn = new MySqlConnection(constr))
using (var cmd = conn.CreateCommand())
using (var mb = new MySqlBackup(cmd))
{
conn.Open();
mb.ImportFromFile(filePath);
}
Why MySqlBackup.NET?
Unlike MySQL Workbench (developer-focused) or MySqlDump.exe (restricted in web environments), MySqlBackup.NET offers:
- End-User Simplicity: Preset parameters for a one-click backup experience.
- Web Compatibility: Runs seamlessly in ASP.NET, bypassing hosting restrictions on executables.
- Programmatic Control: Fine-tuned output handling within .NET.
Dependencies
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 |
Configuration Tips
Unicode Support
For databases with UTF-8 or Unicode characters (e.g., À
, Ñ
, Cyrillic, Chinese), use:
server=localhost;user=root;pwd=qwerty;charset=utf8;
Or, for broader support:
server=localhost;user=root;pwd=qwerty;charset=utf8mb4;
DateTime Handling (MySql.Data Only)
To avoid conversion errors with null or date-only values, add:
server=localhost;user=root;pwd=qwerty;charset=utf8;convertzerodatetime=true;
Performance Benchmark
Compare MySqlBackup.NET to MySqlDump for a 3.5GB database (15M rows):
Task | Tool | Time | File Size |
---|---|---|---|
Backup | MySqlDump | ~2m 35s | 4.66 GB |
Backup | MySqlBackup.NET | ~7m 48s | 4.59 GB |
Restore | MySql.exe | ~8m 41s | - |
Restore | MySqlBackup.NET | ~9m 41s | - |
Full details: Performance Benchmark Wiki
Additional Tools
Backup All Databases
Export all databases to separate SQL files with this sub-project:
MySqlBackup_All_DB
License
MySqlBackup.NET is released under The Unlicense, making it free for any use.
Conclusion
MySqlBackup.NET empowers developers and end-users alike with a robust, .NET-native solution for MySQL database management. Whether for desktop apps, web services, or automated backups, it’s a versatile addition to your toolkit.
Explore more on GitHub!
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
.NET Framework | net461 was computed. net462 is compatible. net463 was computed. net47 was computed. net471 is compatible. net472 was computed. net48 is compatible. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.6.2
- MySqlConnector (>= 2.4.0)
-
.NETFramework 4.7.1
- MySqlConnector (>= 2.4.0)
-
.NETFramework 4.8
- MySqlConnector (>= 2.4.0)
-
.NETStandard 2.0
- MySqlConnector (>= 2.4.0)
- NETStandard.Library (>= 2.0.3)
-
.NETStandard 2.1
- MySqlConnector (>= 2.4.0)
-
net6.0
- MySqlConnector (>= 2.4.0)
-
net8.0
- MySqlConnector (>= 2.4.0)
-
net9.0
- MySqlConnector (>= 2.4.0)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on MySqlBackup.NET.MySqlConnector:
Package | Downloads |
---|---|
Panda.Tools
Package Description |
|
CL.Sinks.MySql.Backup.MySqlConnector
MySql helper library that uses fluent interface to backup/restore MySql Database to/from different storage locations such as Local, Azure Blob, S3, DropBox, OneDrive, DO spaces, etc. storage. It's using MySqlBackup.NET as core library to perform work of backup/restore |
|
daG.Core
daG dag |
|
DoNext.Abp.SqlSugarCore
Package Description |
|
Yi.Framework.SqlSugarCore
Package Description |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on MySqlBackup.NET.MySqlConnector:
Repository | Stars |
---|---|
ShokoAnime/ShokoServer
Repository for Shoko Server.
|
Version | Downloads | Last Updated |
---|---|---|
2.6.5 | 122 | 8/4/2025 |
2.6.4 | 561 | 7/14/2025 |
2.6.3 | 146 | 7/13/2025 |
2.6.2 | 210 | 7/11/2025 |
2.6.1 | 324 | 7/4/2025 |
2.6.0 | 146 | 7/4/2025 |
2.3.9 | 11,630 | 3/12/2025 |
2.3.8 | 390,051 | 3/7/2023 |
2.3.7 | 10,044 | 10/18/2022 |
2.3.6 | 18,375 | 10/17/2021 |
2.3.5.1 | 1,135 | 10/6/2021 |
2.3.5 | 793 | 9/23/2021 |
2.3.4.2 | 1,004 | 9/21/2021 |