Command-line mode on macOS
Last modified: April 10, 2024
You can use Terminal to run dbForge Data Generator for MySQL on a Mac.
Note
This topic describes the CLI-powered access to the functionality of dbForge Data Generator 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 populate a database with data directly 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 Data Generator for MySQL\datagenerator.com" /generatedata /connection:"User Id=[yourusername];Host=[host];Database=[database];Character Set=utf8" /password:[yourpassword]; /projectfile:"C:\users\crossover\My Documents\[filename].dgen"
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 Generator for MySQL.
--check --wait-children --start
…are the options that configure the launch of the application.
"C:\Program Files\Devart\dbForge Data Generator for MySQL\datagenerator.com"
/generatedata /connection:"User Id=[yourusername];Host=[host];Database=[database];Character Set=utf8" /password:[yourpassword];
/projectfile:"C:\users\crossover\My Documents\[filename].dgen"
…is the command to run data generation with the specified options.
Worked example
Let us look at a worked example command to generate data for the sakila_test database that resides on the dbfmylast server.
/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/bin/wine --bottle 'dbForge_MySQL' --check --wait-children --start "C:\Program Files\Devart\dbForge Data Generator for MySQL\datagenerator.com" /generatedata /connection:"User Id=yourusername;Host=dbfmylast;Database=sakila_test;Character Set=utf8" /password:yourusername /projectfile:"C:\users\crossover\My Documents\sakila_test(dbfmylast).dgen"
The data generation begins and finishes successfully.
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.
/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/bin/wine --bottle 'dbForge_MySQL' --check --wait-children --start "C:\users\crossover\My Documents\generatedata.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 Generator for MySQL.
--check --wait-children --start
…are the options that configure the launch of the application.
"C:\users\crossover\My Documents\generatedata.bat"
…is the parameter that specifies the path to the batch file.
Note
You can automate the launch of dbForge Data Generator from the command line using the standard macOS scheduler.