top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

How to synchronize two MYSQL database running on different server?

0 votes

I have a database on local computer and same on remote, I want to sync both server any suggestion on how to proceed?

posted Aug 22, 2014 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Replication is not very hard to create.

Here's some good tutorials:

Here some simple rules you will have to keep in mind (there's more of course but that is the main concept):

Setup 1 server (master) for writing data.
Setup 1 or more servers (slaves) for reading data.
This way, you will avoid errors.

For example: If your script insert into the same tables on both master and slave, you will have duplicate primary key conflict.

You can view the "slave" as a "backup" server which hold the same information as the master but cannot add data directly, only follow what the master server instructions.

NOTE: Of course you can read from the master and you can write to the slave but make sure you don't write to the same tables (master to slave and slave to master).

I would recommend to monitor your servers to make sure everything is fine.

Let me know if you need additional help

answer Aug 24, 2014 by Rahul Singh
Similar Questions
+1 vote

if you set up your LAN MySQL server in to cluster, will it make the new data's entered on a laptop MySQL database that is not connected on the LAN synchronize with the cluster, once that laptop got connected with the LAN again? Is it also possible to set up a cluster on a web host MySQL, so that when you log in on the online database, your offline data will synchronize with the MySQL cluster on your web host?

0 votes

Is it possible to connect database with c code, if yes then how?

If possible share the sample code for connecting to a MySQL database and run a sample query....

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.