Sync Tables from MySQL to MSSSQL - php

Is there a way to sync specific tables from MySQL to MSSQL and vice versa?
For example:
-Sync tbl_employees(MySQL) to tbl_employees(MSSQL)
-Sync tbl_attendance(MSSQL) to tbl_attendance(MySQL)
I've read about MSSQL Linked Server, but I don't really understand how it works.
What I want is that whenever there are changes on the MySQL database when I use PHP, the changes will be synced automatically to MSSQL database which is manipulated by a .NET application.
I don't know if I explained it well enough. If you have any questions, please ask on the comments. It would really help me a lot.

set-up SQL Server Linked Server to MySQL,
then synchronize the tables what ever u want
more details are here???
http://www.ideaexcursion.com/2009/02/25/howto-setup-sql-server-linked-server-to-mysql/

You can manually create a middle layer application with multiple connection... and do it manually...but its only applicable for small scale purposes.else
You can Create a linked server between SQLServer and MySQL Server. configure the Linked Server Provider, but all subsequent connections require only a DSN and Linked Server.

Related

How do keep remote MySQL DBs synced up with a master MySQL DB (using PHP)?

I have a system in which there are several copies of a MySQL DB schema running on remote servers (and it's not possible to consolidate them all into one DB schema in the cloud).
However, this has proven troublesome because whenever the master DB schema is updated, I have to then remotely log into all the other servers and manually update the schemas using the sync tool in MySQL Workbench, which honestly doesn't work very well (i.e., it doesn't catch changes to views, etc.).
As such, I would like to come up with a way to have the master DB schema stored somewhere in AWS and have all the other, remote instances do something like a daily check for anything that's different between the schema locally installed on that server and the master schema in AWS.
Are there tools out there for this sort of thing, and what are they called? Also, because the application itself is written in PHP, using a tool that's easy to use in PHP would be ideal.
Thank you.
Also, I should note that a lot of the remote schemas are stored on servers behind very secure firewalls, so I don't think that pushing the master DB schema to the remote instances will work. Instead, I think that the request for the schema update has to originate from each of the remote servers to the master schema on AWS, if that makes a difference at all.
Db-sync project for MySql sounds like the tool for you. Here is git repo: https://github.com/mrjgreen/db-sync

Is it possible to link 2 Databases MySQL on different servers, together ? like an Accessible backup

I have this technical task, 2 times this week.
Task consist to link, connect and work with 2 Databases on different servers. Inject the datas from the old DB into the new DB. As this the old DB is use like an accessible backup and the new server will be more light, just get the datas when it needs.
I saw there is relational DB-tables but it needs to be on the same server no ?
Does an online Cloud works this way ?
Thanks
Noe
You can use distributed tables in MySQL whenever FEDERATED engine is used.
MySQL -- Joins Between Databases On Different Servers Using Python?
I need to join table from other database and sometimes other server
Join tables from two different server
Otherwise you have to create application that will connect both databases and transfer data between them. With any programming language. Even with MS Access :)
Or use internal replication engine if it suits.
What you need is a service like google cloud,
First you would create VM instance and load balance the mysql connection between two databases.
Note**
If you want faster or more lean mysqls calls, you should try indexing. try the link below
#http://www.infoworld.com/article/2616674/database-administration/10-essential-performance-tips-for-mysql.html

How to add additional information to Axapta Database without administrative privileges?

I am writing for advice on whether solution you recommend to choose.
Here is in a nutshell what I have:
Axapta databse on MS SQL Server 2008 R2.
Several SQL queries using the data of the database through PHP web application.
Webserver, which is running web application.
No administrator privileges on the Axapta databse (only SELECT permission).
Rights to write and modify on the webserver with MySQL database.
Light computer with Windows OS permanently working on the network. On this light computer I have admin rights.
Here's what I want to achieve :
Creating replication (exact copy) of few (10) tables on the webserver as another database, which will sync up as often as possible with Axapta database .
Adding some dictionary tables and views for the new database (to be able to insert the dictionary to earlier SQL queries) .
For now, I came up with this solutions:
I tried to add 'replace' and 'case when' to SQL queries on the Axapta database, without any other additional databases. However, with these new large dictionaries, query performance was poor and waiting for the results drived me crazy ;)
The only thing I could do is a manual export via ODBC to a MySQL webserver database. Is there a free program to automate this process? I mean eg. hourly update data from Axapta MSSQL database to webserver MySQL database (with help of this light computer which I mentioned before)?
Please let me know if you see any other possibilities to expand utlility of webapplication which uses Axapta database.
I don't know if there are some SQL sync agent from MSSQLServer to MySQL.
If you are writing your own tool, you can try to get your diff by yourself:
delete MySQL records where the RecId is not available in MSSQLServer anymore
insert new records for MSSQLServer records with unknown RecId
update records when ModifiedDateTime is greater than your last sync
At last I found a powerful solution, and reccomend it to everyone who has similar issue. PDI -Pentaho Data Integration (Community Edition) is a perfect way to do the dictionary transformations I mentioned above. It could even read from .xls or .txt files. You could get it from the link below, and don't forget to be active developer community member.
http://community.pentaho.com/projects/data-integration/

How to send data updates to a hosted MySQL database remotely over the internet?

I have a simple MySQL database (one table with 12 rows of data and 5 columns) sitting on the web-server of my host provider.
On my home PC I create the data programmatically and store it in a free version of SQL Server (on my home PC). I would like to "upload" this data to the MySQL db in real time (or as close as I can get) over the internet (I'm assuming this is the only way to connect the pipes).
I know that opening up a MySQL database to a remote internet connection probably is not a "secure" thing to do, but the resulting data table will be publicly available anyway via an "app" so I'm not too worried about that (I suppose a hacker could "overwrite" my data with their own if they were both industrious and inclined) but I think the risk/reward is so small its not a major concern.
Anyway, what is the easiest way to do this with some semblance of security? I only know how to program in VB (I did a little HTML and ASP back in the day, but that was a long time ago). I could learn a few lines of code in another language if need be.
I do not have a static IP, and I've never actually interacted with a MySQL database before (only SQL server, so my MySQL knowledge/ familiarity is zero...but a db is a db, so how hard can it be?). Because of my home network firewall, I can't allow connections "in". I will have to make the connection to the MySQL db "out" from my home PC --> to the hosted database.
Ok this problem is not actually super simple.
What you will find is most shared hosting providers do not allow just any IP to access their databases.
Solution? set the IP for your computer of course! BUT.....you are probably on home internet connection so your IP address can CHANGE (if you have a static IP you are a lucky person!)
So the best way - create a mini-API!
Basically, you want to post your data to a script (with some security of course) that then inserts this data into the database.
It is a lot of work but having done all this before it seems to be the only way unless you have a dedicated server / advanced access privileges!
You could take a look at WAMP for your home pc. It's simple to use.
And then you should take a look at Mysql remote connections(some details here)
I would try this:
At your local computer install MySQL server, there's a free community
edition available for download, try the web installer since its more lightweight. Use the
custom installation and make sure MySql Workbench is selected too.
Workbench has a migration tool for the most common databases, Try this locally, so you can tell if all your data is correctly migrated from your local SQL Server to a MySQL db and there are no data losses in the process.
Then, You could probably connect through Workbench to your online MySQL db
and migrate your data to it directly from your just created local db. In case you cannot connect, make a backup of your local db and send the files to
your server by ftp or similar process. Then, simply restore DB from the backup file on your
online server.
Hope this helps!

Two way mysql database synchronization

I am developing an application whose database needs to be replicated in both directions over multiple number of local offline clients.
Please see the general explanation about it:
User installs client software on personal computer.
User synch data from the remote database server onto local database.
Now User can work on this local database and perform insert, update, delete on it.
At the same time other people can also do insert, update, delete on remote database.
User then connect to remote database and commit their local changes to the remote one.
User retrieve the remote change(Done by other people in remote database) onto their local database.
Right now the idea in my mind is that, We need to track the changes making in remote and local database and creating the web service for replicating the changes, but somewhere I am getting problem with primary keys that might be the same that generated in local and remote database. But this is approach is very lengthy, I also have doubt that it will work on real time or not.
My question is that is there any technology/tool in the MYSQL Server that help me to achieve this task without creating web services. I read out about mysql replication but it work for only one side replication i.e. Master - Slave, I need two sided synchronization.
You may use "Replication concept" between Master and Slave database.
You can read and get some idea about it.
http://learnmysql.blogspot.in/2010/10/setup-and-test-mysql-replication-in-20.html
http://www.percona.com/doc/percona-xtrabackup/2.1/howtos/setting_up_replication.html

Categories