Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is a good way to sync two MySQL databases?

I would like to sync the data in my production website's database to my local development database. Right now, I am just using the PHPMyAdmin interface to export it from one, and then I import it into the other.

These would be user-initiated sync's, not necessarily periodic or automated (something like a one-click sync).

share|improve this question… This could solve your problem I hope – Mathew Nov 15 '15 at 8:11
up vote 18 down vote accepted

Here are a couple of ideas:

  1. Use Replication:
  2. Use mysqldump in an import/export script to semi-automate it
share|improve this answer
Use mysqldump in an import/export script might not be feasible for large databases, e.g if a database is over 1gb, it would not be feasible. – Shoaib Iqbal Dec 10 '15 at 5:55

SQLyog Enterprise and Ultimate can do this.

alt text

alt text

SQLyog has a free version although it cannot do the syncing operations unfortunately. The paid versions start at $69 but a 30-day trial is available. For a free solution, replication is your best bet as quickcel outlined, although it requires a bit of configuration.

It now also has feature called 'Visual Data Compare' where data can be compared and synched visually.

enter image description here

share|improve this answer
not a bad answer for WINDOWS users.. – Adam F Feb 21 '15 at 17:04

SQLYog's SJA tool (free for Linux) can do this brilliantly and I have used it for years and years already. All it takes is an XML file generated with the correct login info, your database and tables desired. I could not have done without it.

share|improve this answer

For a free and reliable one-off MySQL synchronization tool, check out Percona Toolkit (formerly Maatkit):

share|improve this answer

You must log in to answer this question.

protected by Community Mar 5 '13 at 19:26

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged .