All Projects → MySqlBackupNET → Mysqlbackup.net

MySqlBackupNET / Mysqlbackup.net

Licence: unlicense
A tool to backup and restore MySQL database in C#/VB.NET/ASP.NET.

Programming Languages

csharp
926 projects

Labels

Projects that are alternatives of or similar to Mysqlbackup.net

Koa2 Blog
第一个web项目,仿照cnode,欢迎新建账号试用
Stars: ✭ 141 (-6%)
Mutual labels:  mysql
Go Mysqlstack
MySQL protocol library implementing in Go (golang)
Stars: ✭ 145 (-3.33%)
Mutual labels:  mysql
Meetingfilm
基于微服务架构的在线电影购票平台
Stars: ✭ 149 (-0.67%)
Mutual labels:  mysql
Js Sql Parser
SQL(select) parser written with jison. parse SQL into abstract syntax tree(AST) and stringify back to SQL. sql grammar follows https://dev.mysql.com/doc/refman/5.7/en/select.html
Stars: ✭ 141 (-6%)
Mutual labels:  mysql
Go Cache
This project encapsulates multiple db servers, redis、ledis、memcache、file、memory、nosql、postgresql
Stars: ✭ 143 (-4.67%)
Mutual labels:  mysql
Polluter
The easiest solution to seed database with Go
Stars: ✭ 146 (-2.67%)
Mutual labels:  mysql
Laravel Db Profiler
Database Profiler for Laravel Web and Console Applications.
Stars: ✭ 141 (-6%)
Mutual labels:  mysql
Xupdateservice
Use Spring Boot easy build, Gradle build, and provide update service for XUpdate.(使用Spring Boot简易搭建,Gradle构建,为XUpdate提供更新服务)
Stars: ✭ 149 (-0.67%)
Mutual labels:  mysql
Dapper.fsharp
Lightweight F# extension for StackOverflow Dapper with support for MSSQL, MySQL and PostgreSQL
Stars: ✭ 145 (-3.33%)
Mutual labels:  mysql
Mysql Swift
A type safe MySQL client for Swift
Stars: ✭ 148 (-1.33%)
Mutual labels:  mysql
Oxidtools
200 TOOLS BY 0XID4FF0X FOR TERMUX
Stars: ✭ 143 (-4.67%)
Mutual labels:  mysql
Sns Forum Website
牛客网高级项目(SNS+社区问答类网站)
Stars: ✭ 143 (-4.67%)
Mutual labels:  mysql
Canal Elasticsearch
基于阿里巴的canal向elasticsearch中同步数据mysql数据的小工具
Stars: ✭ 147 (-2%)
Mutual labels:  mysql
Sqlingo
💥 A lightweight DSL & ORM which helps you to write SQL in Go.
Stars: ✭ 142 (-5.33%)
Mutual labels:  mysql
Algernon
🎩 Small self-contained pure-Go web server with Lua, Markdown, HTTP/2, QUIC, Redis and PostgreSQL support
Stars: ✭ 1,880 (+1153.33%)
Mutual labels:  mysql
Limesurvey
Limesurvey is the number one open-source survey software.
Stars: ✭ 1,918 (+1178.67%)
Mutual labels:  mysql
Lapidus
Stream your PostgreSQL, MySQL or MongoDB databases anywhere, fast.
Stars: ✭ 145 (-3.33%)
Mutual labels:  mysql
Carbon Forum
A high performance open-source forum software written in PHP. Discussions Tags based with Quora/StackOverflow style.
Stars: ✭ 1,814 (+1109.33%)
Mutual labels:  mysql
Querybuilder
SQL query builder, written in c#, helps you build complex queries easily, supports SqlServer, MySql, PostgreSql, Oracle, Sqlite and Firebird
Stars: ✭ 2,111 (+1307.33%)
Mutual labels:  mysql
Chat Realtime
Public & Private message. MySQL & Firebase.
Stars: ✭ 147 (-2%)
Mutual labels:  mysql

This project is moved from https://mysqlbackupnet.codeplex.com/.

MySqlBackup.Net

A tool to backup and restore MySQL database in C#/VB.NET/ASP.NET.

Article at CodeProject.com

How to Add This Library into Your Project

Read this wiki: How to Add This Library into Your Project

Backup ALL Databases in 1 Click

Export all the databases one by one to separate SQL dump files. This a sub-project expansion using MySqlBackup.NET. Read more: MySqlBackup_All_DB

Download

https://github.com/MySqlBackupNET/MySqlBackup.Net/releases

Install via NuGet: PM> Install-Package MySqlBackup.NET
https://www.nuget.org/packages/MySqlBackup.NET/

Acknowledgement

MySqlBackup.NET stands on top of 2 options of connector:

Option 1: MySql.Data.DLL Developped by MySQL (Oracle), https://dev.mysql.com/downloads/connector/net/.

Option 2: Devart dotConnect Express Developped by Devart, https://www.devart.com/dotconnect/mysql/.

Backup/Export a MySQL Database

string constring = "server=localhost;user=root;pwd=qwerty;database=test;";

// Important Additional Connection Options
constring += "charset=utf8;convertzerodatetime=true;";

string file = "C:\\backup.sql";

using (MySqlConnection conn = new MySqlConnection(constring))
{
    using (MySqlCommand cmd = new MySqlCommand())
    {
        using (MySqlBackup mb = new MySqlBackup(cmd))
        {
            cmd.Connection = conn;
            conn.Open();
            mb.ExportToFile(file);
            conn.Close();
        }
    }
}

Import/Restore a MySQL Database

string constring = "server=localhost;user=root;pwd=qwerty;database=test;";

// Important Additional Connection Options
constring += "charset=utf8;convertzerodatetime=true;";

string file = "C:\\backup.sql";

using (MySqlConnection conn = new MySqlConnection(constring))
{
    using (MySqlCommand cmd = new MySqlCommand())
    {
        using (MySqlBackup mb = new MySqlBackup(cmd))
        {
            cmd.Connection = conn;
            conn.Open();
            mb.ImportFromFile(file);
            conn.Close();
        }
    }
}

Introduction

MySqlBackup.NET is a tool (DLL) that can backup/restore MySQL database in .NET Programming Language. It is an alternative to MySqlDump.

This tool is developed in C# but able to be used in any .NET Language (i.e. VB.NET, F#, etc.).

Another benefit of making this tool is, we don't have to rely on two small programs - MySqlDump.exe and MySql.exe to perform the backup and restore task. We will have better control on the output result in .NET way.

The most common way to backup a MySQL Database is by using MySqlDump and MySQL Workbench.

MySQL Workbench is good for developers, but when comes to the client or end-user, the recommended way is to get every parameter preset and all they need to know is press the big button "Backup" and everything is done. Using MySQL Workbench as a backup tool is not a suitable solution for the client or end-user.

On the other hand, MySqlDump.exe cannot be executed directly from the Web Server. As most providers forbid that, MySqlBackup will be helpful in building a web-based (ASP.NET) backup tool.

Features

  • Backup and Restore of MySQL Database
  • Can be used in any .NET Languages.
  • Export/Import to/from MemoryStream
  • Conditional Rows Export (Filter Tables or Rows)
  • Progress Report is Available for Both Export and Import Task.
  • Able to export rows into different modes. (Insert, Insert Ignore, Replace, On Duplicate Key Update, Update)
  • Can be used directly in ASP.NET or web services.

Prerequisite and Dependencies for Development, Compile and Production Usage

MySqlBackup.NET relies on the following component to work.

Option 1: MySql.Data (Connector/NET)

Option 2: Devart Express (dotConnect)

Reminder

Reminder 1

MySqlBackup.NET (or MySqlBackup.DLL) stands on top of MySql.Data.DLL which also stands on top of .NET Framework, which uses UTF8 encoding by default. If your database involves any UTF8 or Unicode Characters. You must use a MySQL database with default character of UTF8 while handling Unicode Characters, such as

  • Western European specific languages, the character of 'À', 'ë', 'õ', 'Ñ'.
  • Russian, Hebrew, India, Arabic, Chinese, Korean, Japanese characters, etc.

You are recommended to apply the connection string option of charset=utf8. Example:

server=localhost;user=root;pwd=mypwd;charset=utf8;

Reminder 2

(For MySql.Data connector only) DateTime conversion between MySQL and .NET Framework. In MySQL, there are various of DateTime format, such as null value or Date only data. But, in .NET Framework, there is no null value (or Date only) for DateTime. This error is not caused by MySqlBackup.DLL. MySql.Data.DLL (developed by Oracle) has decided to throw an exception of Data Conversion Error. Therefore, you are strongly recommended to apply the connection string option of convertzerodatetime=true. Example:

server=localhost;user=root;pwd=mypwd;charset=utf8;convertzerodatetime=true;

License

MySqlBackup.Net is licensed under the The Unlicense.

Acknowledgement

Thanks to trembon for repackaging this project into .NET Standard 2.0 and nuget package https://github.com/MySqlBackupNET/MySqlBackup.Net/issues/17

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].