Article

Synchronize MySQL Data Using SQLyog Job Agent

Page: 1 2 3 Next

The next page of the wizard allows you to select the tables you want to sync.

1283_SQLog3.gif

Selecting [ALL]… will sync all the tables that are present in the database. If you don't want to sync all the tables, select each table individually without selecting the [ALL]… option. You can even change the order in which tables will be synced using the "Move Up…" and "Move Down…" options.

Additionally, you can configure SJA to detect changes only for specific columns. This makes it an ideal tool to use to sync data, even if there is limited bandwidth. Since SQLyog uses checksums to detect changes, unselecting BLOB data may significantly speed up the process, as these columns will not be used to generate checksums. To select specific columns, check the corresponding table and select the columns.

1283_SQLog4.gif

Clicking on the "SQL Where" button will open another window, where you can specify a valid SQL WHERE clause.

1283_SQLog5.gif

This is very helpful when you don't want to sync archived data.

The two options in Select Table's page are:

  • Abort Synchronization On Error – Checking this option aborts the sync operation whenever it comes across a problem. If you leave it unchecked, SQLyog will continue with the sync process. Otherwise, it will stop at the first occurrence of an error.
  • Set FOREIGN_KEY_CHECKS=0 for Target – If this option is checked, SQLyog issues the SET FOREIGN_KEY_CHECK=0 command before the sync on the target server. It allows you sync data without validating FOREIGN KEY integrity.

Selecting Synchronize Now... on the next page will start the synchronizing process. SQLyog starts up SJA as a child process to sync the databases. The complete detail of the sync process is shown in the last step of the wizard.

1283_SQLog6.gif

1283_SQLog7.gif

Running SJA from the command prompt

You can also execute SJA as a command line tool that takes an XML file containing the session detail. In Linux, the only way to use SJA is to run it from command prompt. You can execute SJA from command line with the XML file as a parameter. The syntax of SJA is:

sja  <jobfile> [–l<logile>]

sja supports the following options:

  • -l<filename> - File where sja will log all the errors it has encountered while syncing databases. If no log file is specified, sja will create a default log file sja.log in the current directory of the executable, and will log all error messages in this file.

If you liked this article, share the love:
Print-Friendly Version Suggest an Article