将数据从 SQL Server 传输到 MySQL

发布于 2024-07-23 03:49:20 字数 246 浏览 5 评论 0原文

我需要将 SQL Server 2008 Express 中的 4 个表中的大约 2m 条记录传输到 MySQL。

在 C# 中,我可以使用 表值参数在事务中快速插入这些记录。 (大约 50 秒)。

如何在 C# 中为 MySQL 做类似的事情?

I need to transfer around 2m records from 4 tables in SQL Server 2008 Express to MySQL.

In C# I can insert these records very quickly within a transaction with the Table-Valued parameter. (Around 50 seconds).

How can I do something similar for MySQL in C#?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

给不了的爱 2024-07-30 03:49:20

阅读MySQL参考手册中的说明。 您能做的最好的事情就是使用 LOAD DATA INFILE ,同时在之前禁用索引并在之后重新创建(从而批量计算它们)。 如果这不适合您,还有更有趣的建议。

Read the explanations in the MySQL Reference Manual. The best you can do is use LOAD DATA INFILE while disabling indices before and recreating (and thus batch-calculating them) afterwards. There is more interesting advice if that doesn't work out for you.

囚我心虐我身 2024-07-30 03:49:20

您是否只能使用 C# 进行迁移? 如果您不是并且只想传输数据,您可以使用 MySQL 迁移工具包 为您进行迁移。

Are you locked into using C# for the migration? If you're not and only want to transfer the data you can use the MySQL Migration Toolkit to do the transfer for you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文