简体   繁体   English

通过MSSQL复制将MSSQL数据库复制到MySQl

[英]Replicating MSSQL Database to MySQl Through MSSQL Replication

It is a possible of duplicate question may be but please suggest me some work around 这可能是重复的问题,但请建议我一些解决方法

I got this requirement. 我有这个要求。

I have a MSSQL Database with almost 30 Tables with millions of records. 我有一个MSSQL数据库,其中包含将近30个具有数百万条记录的表。 Now i need to take Replica of the same in MySql. 现在,我需要在MySql中复制相同的副本。

The Solution which i am thinking are (This may contains loopholes and it may not be good) 我在想的解决方案(可能存在漏洞,可能不是很好)

Sol 1 :- I created a linked server of MySql and by using trigger in MSSQL Tables and insert in MySQl For the existing records by using import wizard of workbench import the data. Sol 1:-我创建了一个MySql的链接服务器,并使用MSSQL表中的触发器创建了一个链接服务器,并插入MySQl中。使用工作台的导入向导为现有记录导入数据。

Sol 2 :- Using SymmetricDS. Sol 2:-使用SymmetricDS。

What is the best way to achieve this. 实现此目标的最佳方法是什么。

I am very new to Database Administration stuffs. 我是数据库管理人员的新手。 Please help me in this regard. 请在这方面帮助我。

Note :- After we replicated to MySql it should be in sync with MSSQL. 注意:-复制到MySql之后,它应该与MSSQL同步。

UPDATE :- If anyone knows as the way dan b said how to do it via SQL Server Replication Using ODBC please give some reference. 更新:-如果有人知道dan b所说的如何通过使用ODBC进行SQL Server复制的方式,请提供一些参考。

I tried this steps here . 在这里尝试了此步骤。 In the second step if i click new publication under Replication SSMS i got this error 在第二步中,如果我单击“复制SSMS”下的新出版物,则会收到此错误

SQL Server replication requires the actual server name to make a 
connection to the server. 
Connections through a server alias, IP address, or any other 
alternative name are not suppported. Specify the actual server name, 
'USER3-PC'. (Replication.Utilities)

I installed SQL 2008 R2 Express. 我安装了SQL 2008 R2 Express。 And this i tried in my local machine. 这是我在本地计算机上尝试过的。

I would just create PHP scripts to do it. 我只是创建PHP脚本来做到这一点。 I would create on script per table and run them from the command line. 我会在每个表的脚本上创建并从命令行运行它们。 There are drivers for both MSSQL and MySQL. 有适用于MSSQL和MySQL的驱动程序。 Since PHP is loosely typed this should be a breeze. 由于PHP是松散类型的,因此应该很容易。 You can get the create and insert statements right from SQL Server Management Studio. 您可以直接从SQL Server Management Studio获取create和insert语句。

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

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