You can use Terminal to run dbForge Data Compare for MySQL on a Mac.
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 Terminal. To do that, run the following command:
/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/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:
/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/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.
Let us look at a worked example command to compare the data in two MySQL databases that reside on the dbfmylast server.
/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/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.
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.
/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/bin/wine --bottle 'dbForge_MySQL' --check --wait-children --start "C:\users\crossover\My Documents\datacompare.bat"
In this example:
/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/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 macOS scheduler.