简体   繁体   English

我的sql数据库备份在客户端的.SQL文件中?

[英]My sql database backup in a .SQL file on client side?

i am creating a small tool using C# and MySQL, this tool has a small db in MySQL i want to backup the DB as a .SQL file that i can again load to MySQL when needed. 我正在使用C#和MySQL创建一个小型工具,该工具在MySQL中有一个小型数据库,我想将该数据库备份为.SQL文件,然后可以在需要时再次加载到MySQL。

the problem is how to get .SQL file on client side using any query etc. and load it back to db. 问题是如何使用任何查询等在客户端获取.SQL文件并将其加载回db。

i don't want to use sql dump or any other method for which i have to write a batch file or call an external process on client. 我不想使用sql dump或我必须为其编写批处理文件或在客户端上调用外部进程的任何其他方法。

is there any simple and straight forward way to it with c# programming 使用C#编程是否有任何简单直接的方法

help needed regards. 帮助需要的问候。

All object definitions you can get using SHOW CREATE TABLE, SHOW CREATE VIEW, SHOW CREATE TRIGGER, ... and so on; 您可以使用SHOW CREATE TABLE,SHOW CREATE VIEW,SHOW CREATE TRIGGER等获得的所有对象定义;等等。 all objet names you can get from information_schema system database. 您可以从information_schema系统数据库中获得的所有对象名称。

Only 'INSERT INTO table' statements you should generate itself. 您只应生成“ INSERT INTO table”语句。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM