文件名称:MySQL_Backup_Restore
- 所属分类:
- SQL Server数据库
- 资源属性:
- [Windows] [Visual.Net] [源码]
- 上传时间:
- 2016-07-26
- 文件大小:
- 256kb
- 下载次数:
- 0次
- 提 供 者:
- xps****
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
Easy Backup and Restore MySQL utility.-Introduction
It is the basic, easy to use MySQL Backup/Restore utility.
Background
It is basically developed for non programmers. So, anyone can use it. The simplest tool for the job.
Using the code
Backup method takes two arguments, i.e, path to save the backup file and connection string.
Hide Copy Code
// Backup MySql
private void MySQLBackup(string path, string constring)
{
string file path+ txt_database.Text+ _ + DateTime.Now.ToString( yyyy-MM-dd_hh-mm-ss )+ .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()
}
}
}
}
Now to the restore method with the same two arguments
Hide Copy Code
// Restore MySQL(.sql) file to the
private void
It is the basic, easy to use MySQL Backup/Restore utility.
Background
It is basically developed for non programmers. So, anyone can use it. The simplest tool for the job.
Using the code
Backup method takes two arguments, i.e, path to save the backup file and connection string.
Hide Copy Code
// Backup MySql
private void MySQLBackup(string path, string constring)
{
string file path+ txt_database.Text+ _ + DateTime.Now.ToString( yyyy-MM-dd_hh-mm-ss )+ .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()
}
}
}
}
Now to the restore method with the same two arguments
Hide Copy Code
// Restore MySQL(.sql) file to the
private void
(系统自动生成,下载前可以参看下载内容)
下载文件列表
MySQL Backup
............\MySQL Backup
............\............\App.config
............\............\bin
............\............\...\Debug
............\............\...\.....\mysql backup
............\............\...\.....\MySQL Backup.exe
............\............\...\.....\MySQL Backup.exe.config
............\............\...\.....\MySQL Backup.pdb
............\............\...\.....\MySQL Backup.vshost.exe
............\............\...\.....\MySQL Backup.vshost.exe.config
............\............\...\.....\MySQL Backup.vshost.exe.manifest
............\............\...\.....\MySql.Data.dll
............\............\...\.....\MySqlBackup.dll
............\............\...\Release
............\............\Main.cs
............\............\Main.Designer.cs
............\............\Main.resx
............\............\MySQL Backup.csproj
............\............\obj
............\............\...\Debug
............\............\...\.....\DesignTimeResolveAssemblyReferences.cache
............\............\...\.....\DesignTimeResolveAssemblyReferencesInput.cache
............\............\...\.....\MySQL Backup.csproj.FileListAbsolute.txt
............\............\...\.....\MySQL Backup.csproj.GenerateResource.Cache
............\............\...\.....\MySQL Backup.csprojResolveAssemblyReference.cache
............\............\...\.....\MySQL Backup.exe
............\............\...\.....\MySQL Backup.pdb
............\............\...\.....\MySQL_Backup.Main.resources
............\............\...\.....\MySQL_Backup.Properties.Resources.resources
............\............\...\.....\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs
............\............\...\.....\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs
............\............\...\.....\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs
............\............\...\.....\TempPE
............\............\Program.cs
............\............\Properties
............\............\..........\AssemblyInfo.cs
............\............\..........\Resources.Designer.cs
............\............\..........\Resources.resx
............\............\..........\Settings.Designer.cs
............\............\..........\Settings.settings
............\MySQL Backup.sln
............\MySQL Backup.v12.suo