Recently, I have found a useful function of phpMyAdmin, by using phpMyAdmin you can synchronize databases on the same or different computers very easily.

You may have several databases on different computers or just one computer, they are of the same type (maybe they are all Elgg databases), and they may be for different purposes (maybe one is for developing, one is production version). And sometimes you may want to synchronize these databases. Maybe you want to synchronize the database from the developing server into the production server. You can export the database from the developing server into a SQL file. Then you can import this file to the production server. This will work but I think using the sync feature of phpMyAdmin is a better solution.

To use this feature, first you need to add the following line into config.inc.php, the configuration file of phpMyAdmin.

$cfg['AllowArbitraryServer'] = true;

This will allow you to connect to remote server. Or you can just synchronize between local databases.

And when you log into phpMyAdmin, you may notice that the login page has one change. Please look at the following picture.

You can input the server you want to log into or just leave it empty to log into localhost. And before logging into a remote server, please make sure the account on remote server is allowed logging in from other hosts. You can go the the Users tab to check this.

In the column Host, % means this account can log in from any computer, localhost means you can only log in from local computer. You can change the existed account or create a new account for logging in from other computers.

Then you can go to the Synchronize page.

Source database will not be changed and you can make the target database partially or totally the same with source database. After filling all the information, just click Go.

On this page, you can see what the differences between the two databases are and choose what to synchronize.

After selecting, you can view the details of the selected differences and synchronize them.

Or you can choose to synchronize the whole database.

As you can see, the source and target databases are the same now.

If you often need to synchronize databases, I think this feature can save you some time.

Views: 11249

Comment

You need to be a member of Toyhouse to add comments!

Join Toyhouse

Events

CC Creative Commons

Share your knowledge and creativity with the world, protect your work with CC Licenses and discover other creative works and CC activities around the world. For Chinese CC, please go to: (中文版知识共享协议网站请点击http://cn.creativecommons.org.

 

 

Creative Commons licenses provide a flexible range of protections and freedoms for authors, artists, and educators.

Photos

Loading…
  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

Sponsors

© 2014   Created by Toyhouse Administrator.

Badges  |  Report an Issue  |  Terms of Service