SqlBulkCopy的等效在MySQL? [英] SqlBulkCopy equivalent in MySql?

查看:2982
本文介绍了SqlBulkCopy的等效在MySQL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我更习惯到SQL Server,我想知道,如果在MySQL我能找到的东西模拟使用SqlBulkCopy。我已经写在WPF / Silverlight和使用Connector / NET连接到MySQL服务器C#中的数据编辑,我应提供的编辑器进行一些MySQL数据库的完整备份里面的函数。我对服务器不能直接访问,所以我不能使用dump或其他命令行工具。

I am more used to SQL Server and I'd like to know if in MySql I can find something analog to SqlBulkCopy. I have a data editor written in WPF/Silverlight and C# using Connector/NET to connect to a MySql server, and I should provide a function inside the editor to make a full backup of some MySql databases. I have no direct access to the server so I cannot use dump or other command-line tools.

会是什么,然后通过连接器仅使用C#代码倾倒整个数据库的最佳方式?我只需要导出数据大量成XML,CSV或与我自己的SQL查询之类的,或者是有这样的任务,任何建议的方式?

What would then the best way of dumping a whole database using only C# code via Connector? I just have to massively export data into XML, CSV or the like with my own SQL queries, or is there any suggested way for such tasks?

推荐答案

SELECT INTO OUTFILE 是这样做的标准方法,但它只能将数据转储到服务器的本地文件系统。如果您没有访问到服务器,您将无法访问该转储文件。

SELECT INTO OUTFILE is the standard way to do this, but it can only dump data to the server's local file system. If you don't have access to the server, you won't be able to access the dump files.

我建议的

SHOW CREATE TABLE XXXX组合来检索表SQL和某种形式的 SELECT * FROM XXXX 来检索数据。该Maatkit工具可能是作为参考用。你可以计算出它在做什么,并复制SQL:

SHOW CREATE TABLE XXXX to retrieve the table sql, and some form of SELECT * FROM XXXX to retrieve the data. The Maatkit tools might be useful as reference. You could figure out what it's doing and copy the SQL:

http://www.maatkit.org/doc/mk-archiver.html

这篇关于SqlBulkCopy的等效在MySQL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆