Transfer sql server data to mysql database using program - mysql

I have an old system with sql server database. And I have to create a webiste with mysql database. The old system is still in use and is inserting data to the sql server DB everyday. So, I am thinking write a program that automatically transfer data from the sql server DB to the mysql DB. Any good suggestions? Thanks.

You have an active SQL Server database.
Unless you are planning to decommission this database server (for very good reasons not related to this new application), then the new application should simply query this server.

You can create a small (Maybe in c#) program that keeps running all the times with a timer, and on this timer, get all rows from SQL server that are not marked as "Copied", insert them on MySQL and the update those rows as "Copied". That program need to have access to both databases.

Related

I need connection to an Access Database from a mysql stored procedure to update tables i already create in mysql db

The access database is on server in folder. I need to create a stored procedure to connect to the access database and update the table data. It can be truncate then an insert. It is connecting via stored procedure to the access database i cannot figure out. It has to be done via a job on a schedule.
MySQL (the Sun- then Oracle- owned product) lacks the plumbing to connect to external tables unless they're on other MySQL servers. That is, it only has a FEDERATED storage engine. So, with MySQL you'll have to find some other way to handle your requirement; a MySQL event or other stored code cannot hit your Access tables.
MariaDB, the MySQL fork, has a CONNECT storage engine. It allows the server to hit external tables via ODBC, so you can hit Access with it. MariaDB is almost entirely compatible with MySQL, so maybe you can replace your MySQL server with it. The CONNECT documentation says this, however.
...these table types cannot be ranked as stable. Use them with care in production applications.
To me, that warning means don't do it!. Especially with a busy business-critical application (like a credit department might use) you don't want even a little bit of instability. If you truncate a table and then the reload fails, you'll be able to hear users yelling from the next county.
Your requirement is, I believe, to extract the contents of one (or more) Access tables and import them into a MySQL table. That kind of operation is called extract-transform-load etl. It seems you use SSIS for the purpose. That should work, because SSIS can connect to Access (of course) and to MySQL via the Connector/net or Connector/ODBC drivers.
But, scheduled SSIS packages get run from SQL Server database servers. You didn't say you have one of those at your disposal. If your org does have a production SQL Server instance, you can put your Access - to - MySQL package into it.
Otherwise you will have to figure out a way to run your scheduled etl job without relying on a database job (or event, as they're called in the MySQL world). For that you'll use the Task Scheduler on Windows, or a cronjob on a UNIX-derived OS like Linux or FreeBSD.
I bet you can do this work reliably from a Windows PowerShell script or a Linux shell script.

Database sync between SQL Server and Mysql

I have two different application which run on different database, SQL Server and MySQL. Now I want real time data sync between SQL Server and Mysql - can anybody please tell me. I have already tried data migration, but it copies only data not sync data
Take a look at StreamSets. Open source and can read the SQL Server change tracking (CT) tables and turn them into inserts, updates, and deletes to any database with a JDBC driver including MySQL. It can also use the MySQL binlog to build data pipelines in the other direction.

how to do Data replication on MS SQL Linked server

We have created a MS SQL Linked server for a MYSQL database...I have a data replication questions related to linked server
1.Once a MS SQL Linked server is created between MYSQL and MS SQL,if we insert any new data into existing tables of MYSQL,does the data get automatically replicated to the MSSQL Linked server?
2.If we add new tables or columns how to data replication is handled between MYSQL and MS SQL linked server?is there an automated way to replicate data?
A linked server in SQL server simply provides you the capability to issue commands against a remote server. It does not mean any kind of replication will happen automatically for schema or data. As to how to actually accomplish replication between SQL Server and MySQL, the question has been asked and answered many times. As far as I know you will need to use a third party framework or roll something of your own via ETL, triggers, etc.
https://msdn.microsoft.com/en-us/library/ms188279.aspx
Replication from MySQL to MS SQL

How to access remote MicroSoft SQL Server database from a stored procedure in MySQL

I need to access a remote Microsoft SQL Server database from a stored procedure in MySQL database.
I googled and found that there is a way to access a remote MySQL using federated tables. But I couldn't find anyway to do access MS SQL Server. My exact requirement is, I need to write a stored procedure which can duplicate all the tables and data from a remote MS SQL server database to a local MYSQL database.
Please help..
In short this cannot be done with MySQL federated engine. However you can setup a link from the remote MSSQL server to a MySQL table using the linked server feature of the MSSQL server.
If you can set this up you can have a scheduled job populate the MySQL tables from the MSSQL server side.
I have done the above setup and it is not to difficult.
I would also investigate some ETL tool to do this as it sounds like a ETL job and not something you want to run via stored procedures.
Good Luck.

Link local SQL Express 2005 database to online MySQL database?

I have a software dumping values to a local SQL Express database once a day. What I really need is this data in an online MySQL database. The software cannot be reconfigured to save to a different database setup.
Is there any way of linking the two and having any updates to the local database sent to the MySQL database?
Thanks,
Joe
Do you have access to the server the software sits on? I would create a script and a scheduled task that is on the server, and pulls from one and pushes to the other. This would allow you to code and configure some sort of fail safe mechanism should one or the other be down. Otherwise one other option is to add a trigger for the SQL server for inserts/updates, and configure a MySQL DSN:
http://www.ideaexcursion.com/2009/02/25/howto-setup-sql-server-linked-server-to-mysql/