MySQL 到 SQL Server 的迁移
我有一个充满数据的 mysql 数据库,我需要保留这些数据,但要迁移到 SQL Server 2008。
我知道数据应该从头到尾、表到表去哪里,但我不知道如何移动数据。我浏览过网络,但似乎有一些“解决方案”需要您下载并运行。如果可能的话,我宁愿自己做一些编写脚本或代码的事情。
有人可以推荐最好的方法吗?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
这里有几个选项:
无论您选择哪一个,索引、外键、触发器、存储过程和安全性等非数据工件都必须手动移动。
You have several options here:
Regardless of which you choose, non-data artifacts like indexes, foreign keys, triggers, stored procedures, and security will have to be moved manually.
您是否尝试过 MSFT 的名为 SQL Server Migration Assistance for MySQL 的工具???
https://www.microsoft.com/download/en/details.aspx ?id=1495
Have you tried tool from MSFT called SQL Server Migration Assistance for MySQL ???
https://www.microsoft.com/download/en/details.aspx?id=1495
尝试本教程,从 Mysql 迁移到 SQL Server 非常容易,并且如前面提到的那样简单
http://www.codeproject.com/Articles/29106/Migrate-MySQL-to-Microsoft-SQL-Server
谢谢
Try this tutorial it is very easy to perform migration to SQL Server from Mysql and is straightforward as mentioned
http://www.codeproject.com/Articles/29106/Migrate-MySQL-to-Microsoft-SQL-Server
Thanks
您可以使用 SQL Server 标准版附带的导入/导出向导。
使用 ODBC 数据源从 MySQL 选择“数据源”。注意:您需要首先安装 MySQL 的 ODBC 驱动程序(ODBC 连接器) 。然后,选择您的 SQL Server 目标。选择所有表,然后启动它。您将需要手动添加主键、外键以及索引。
更自动化的方法是使用 SQL Server Migration Assistant for MySQL,也是免费的。它的优点是自动为您重新创建关系和索引。可能是你最好的选择。
You can use the Import/Export Wizard that comes with SQL Server Standard Edition.
Select your 'data source' from MySQL using the ODBC data source. Note: You will need to first install the from ODBC driver for MySQL (ODBC Connector). Then, select your SQL Server destination. Select all tables, and fire it up. You will need to add your primary and foreign keys, and indexes manually.
A bit more automated means would be by using the SQL Server Migration Assistant for MySQL, also free. It has the benefit of recreating the relationships and indexes automatically for you. Probably your best bet.
我以前做过一次。首先,您可以使用 odbc mysql 连接器将 mssql 服务器连接到 mysql 服务器
连接建立后可以编写数据库过程,就像它是两个 mssql 数据库一样。可能最简单的方法是编写一些 sql 批处理脚本,包括一个游标,您可以在其中运行表的每一行,并根据字段决定将来需要该字段的位置。
如果您决定使用光标,您可以使用参数来提高性能。我特别记得
FORWARD_ONLY
参数给了我很大的提升。I did it once, some time ago. First you could couple your mssql server to the mysql server using the odbc mysql connector
After the connection is made you can write you database procedure as you would if it were two mssql db's. Probably easiest to write some sql batch scripts including a cursor where you run through every every row of a table an decide on a field basis where you will need the field in the future.
If you decide to go with the cursor, you can play with the parameter to increase performance. I especially remember the
FORWARD_ONLY
parameter giving a big boost.