Command-line mode on Linux

You can use the native Linux command line to run dbForge Data Compare for MySQL.

Note

This topic describes the CLI-powered access to the functionality of dbForge Data Compare installed into a CrossOver bottle. For more information on the command-line functionality of the tool, refer to the corresponding topics of the documentation.

As an example, let’s see how to compare data from the command line. To do that, run the following command:

"/opt/cxoffice/bin/wine" --bottle "dbForge_MySQL" --check --wait-children --start "C:\Program Files\Devart\dbForge Compare Bundle for MySQL Standard\dbForge Data Compare for MySQL\datacompare.com" /datacompare /source connection:"User Id=[yourusername];Host=[host];Password=[yourpassword];Database=[database];Character Set=utf8" /target connection: "User Id=[yourusername];Host=[host];Password=[yourpassword];Database=[database];Character Set=utf8" /sync

In this example:

"/opt/cxoffice/bin/wine"

…is the command that initiates CrossOver.

--bottle "dbForge_MySQL"

…is the parameter that specifies the name of the bottle that contains dbForge Data Compare for MySQL.

--check --wait-children --start

…are the options that configure the launch of the application.

"C:\Program Files\Devart\dbForge Compare Bundle for MySQL Standard\dbForge Data Compare for MySQL\datacompare.com" 
/datacompare /source connection:"User Id=[yourusername];Host=[host];Password=[yourpassword];Database=[database];Character Set=utf8" 
/target connection: "User Id=[yourusername];Host=[host];Password=[yourpassword];Database=[database];Character Set=utf8"

…is the command to run data comparison with the specified options.

/sync

…changes the Target data according to the Source data.

Worked example

Let us look at a worked example command to compare the data in two MySQL databases that reside on the dbfmylast server.

"/opt/cxoffice/bin/wine" --bottle "dbForge_MySQL" --check --wait-children --start "C:\Program Files\Devart\dbForge Compare Bundle for MySQL Standard\dbForge Data Compare for MySQL\datacompare.com" /datacompare /source connection:"User Id=yourusername;Host=dbfmylast;Password=yourpassword;Database=db_staging;Character Set=utf8" /target connection:"User Id=yourusername;Host=dbfmylast;Password=yourpassword;Database=db_production;Character Set=utf8" /sync

The data comparison and synchronization process begins and finishes successfully.

Data compare from CLI

Run a batch file

You can run not only individual commands, but also generated batch files (*.bat/*.cmd files), which are to be created as usual Windows batch files.

Let’s look at an example of code for a batch file.

"/opt/cxoffice/bin/wine" --bottle "dbForge_MySQL" --check --wait-children --start "C:\users\crossover\My Documents\datacompare.bat" 

In this example:

"/opt/cxoffice/bin/wine"

…is the command that initiates CrossOver.

--bottle "dbForge_MySQL"

…is the parameter that specifies the name of the bottle that contains dbForge Data Compare for MySQL.

--check --wait-children --start

…are the options that configure the launch of the application.

"C:\users\crossover\My Documents\datacompare.bat"

…is the parameter that specifies the path to the batch file.

Note

You can automate the launch of dbForge Data Compare from the command line using the standard Linux scheduler.

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge Data Compare for MySQL.
Request a demo

Request a demo

If you consider employing the Data Compare for your business, request a demo to see it in action.
Ready to start using dbForge Data Compare for MySQL?