This article is a mirror article of machine translation, please click here to jump to the original article.

View: 7474|Reply: 3

[Source] [Actual combat]. NET/C# implements MySQL database backups based on MySqlBackup.NET

[Copy link]
Posted on 10/19/2022 9:05:55 PM | | | |
Requirements: The forum uses a MySQL database, previously used the mydumper tool combined with scheduled tasks to back up the database under the Linux system, and now I have purchased a server dedicated to storage on the Windows system.How do I face a remote MySQL database on Windows?? Using mysqldump.exe can actually back up remote databases, but you need to install MySQL software, and I found some information on the Internet that there is a MySqlBackup.NET package developed by .NET/C# that can be used to backup and restore MySQL databases.

Regularly back up remote MySQL databases in Linux environments
https://www.itsvse.com/thread-10099-1-1.html

MySQL database backup and export
https://www.itsvse.com/thread-4004-1-1.html

MySqlBackup.NET

Tools to backup and restore MySQL databases in C#/VB.NET/ASP.NET.

GitHub address:The hyperlink login is visible.

MySqlBackup.NET is a tool (DLL) that can be used to backup/restore MySQL databases using the .NET programming language. It is an alternative to MySqlDump.

The tool is developed in C#, but can be used in any .NET language (i.e., VB.NET, F#, etc.).

Another benefit of making this tool is that we don't have to rely on two applets ——MySqlDump.exe and MySql.exe to perform backup and restore tasks. We'll have more control over the output in a .NET way.

The most common way to back up a MySQL database is to use MySqlDump and MySQL Workbench.

MySQL Workbench is good for developers, but for clients or end users, the recommended approach is to get each parameter preset, all they need to know is to press the big button "Backup" and everything is done. Using MySQL Workbench as a backup tool is not a suitable solution for clients or end users.

On the other hand, it is not possible to perform MySqlDump.exe directly from a web server. As some vendors prohibit, MySqlBackup will help build web-based (ASP.NET) backup tools.

features

  • Backup and recovery of MySQL databases
  • Available in any .NET language.
  • Export/import to/from MemoryStream
  • Conditional row export (filter table or row)
  • Progress reports are available for exporting and importing tasks.
  • Ability to export rows to different modes. (insert, insert ignore, replace, repeat key update, update)
  • Can be used directly in ASP.NET or web services.


MySqlBackup.NET based on there are three different versions, isDevelop on three different MySQL connection drivers, you can choose any one. As follows:

MySqlBackup.NET -> MySql.Data(The hyperlink login is visible.
MySqlBackup.NET.MySqlConnector -> MySqlConnector(The hyperlink login is visible.
MySqlBackup.Net.DevartExpress -> dotConnect.Express.for.MySQL(The hyperlink login is visible.

Create a new .NET console project and add MySqlBackup.NET packages via NUGET with the following command:

Backup/export the MySQL database with the following code:



Import/restore the MySQL database with the following code:

(End)




Previous:Disk file management tools Everything, SpaceSniffer, Clover
Next:[Practical Operation] Conflicts between referring to different versions of DLLs that rely on redirects
Posted on 10/21/2022 12:25:47 AM |
Learn to learn
Posted on 11/15/2022 6:19:10 PM |
Learn a little
Posted on 1/13/2023 4:30:06 PM |
Take a look at the next study
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com