How can I synchronize two databases/tables in phpMyAdmin?
You can now synchronize databases/tables in phpMyAdmin using the Synchronize feature. It allows you to connect to local as well as remote servers. This requires you to enter server host name, username, password, port and the name of the database. Therefore you can now synchronize your databases placed on the same server or some remote server.
This feature is helpful for developers who need to replicate their database's structure as well as data. Moreover, this feature not only helps replication but also facilitates the user to keep his/her database in sync with another database. Other than the full database, certain tables of the databases can also be synchronized.
You need to fill in the host name of the server, the username and password of an user account already there in MySQL. Port is by default populated with 3306 (MySQL default port). Then the name of the database should be mentioned at the end. All the information other than the port needs to be filled explicitly for the source as well as target servers.
After successfully passing through the authentication phase, the source and target database table names will be displayed. It will be a tabular representation.
On the left, are listed the source database table names. Some of the names have a + plus sign preceding them. This shows that these tables are only present in source database and they need to be added to the target database in order to synchronize the target database. The tables whose names are not preceded by a + sign are already present in the target database.
On the right, are listed the target database table names. There are few table names that have (not present) appended after their names. This means that these tables are to be created in target database in order to synchronize target database with source database. Some table names have a - minus sign preceding them. This shows that these tables are only present in target database and they will remain unchanged in the target database. The column in the middle shows the difference between the source and target corresponding tables.
The difference is depicted by the red and green buttons with S and D letters, indicating that either Structure or Data are not up to date. By clicking on them, they will turn grey, what means that they will be synchronized.