Command-line mode on macOS

Last modified: April 10, 2024

You can use Terminal to run dbForge Studio for MySQL on a Mac.

Note

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

As an example, let’s see how to backup a database from Terminal. To do that, run the following command:

/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/bin/wine --bottle 'dbForgeStudioMySQL' --check --wait-children --start "C:\Program Files\Devart\dbForge Studio for MySQL\dbforgemysql.com" /backup /connection:"User Id=[yourusername];Host=[host];Character Set=utf8" /database:[database_name] /password:[yourpassword] /outputfile:"C:\users\crossover\My Documents\backup\[file_name].sql"

In this example:

/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/bin/wine

…is the command that initiates CrossOver.

--bottle 'dbForgeStudioMySQL'

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

--check --wait-children --start

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

"C:\Program Files\Devart\dbForge Studio for MySQL\dbforgemysql.com" /backup /connection:"User Id=[yourusername];Host=[host];Character Set=utf8" /database:[name database ] /password:[yourpassword] /outputfile:"C:\users\crossover\My Documents\backup\[file_name].sql"

…is the command to run a backup with the specified options.

Note

The path to the executable file will differ depending on how you have installed the Studio - as a standalone tool or as part of the dbForge Edge bundle. Make sure that you have specified a correct path. If you have installed the Studio as part of dbForge Edge, change the path accordingly:

C:\Program Files\Devart\dbForge Edge\dbForge Studio for MySQL>dbforgemysql.com

Worked example

Let us look at a worked example command to backup the MySQL sakila database that resides on the dbfmylast server.

/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/bin/wine --bottle 'dbForgeStudioMySQL' --check --wait-children --start "C:\Program Files\Devart\dbForge Studio for MySQL\dbforgemysql.com" /backup /connection:"User Id=yourusername;Host=dbfmylast;Character Set=utf8" /database:sakila /password:yourpassword /outputfile:"C:\users\crossover\My Documents\backup\sakila_202206060742.sql" 

The backup process begins.

Backup from CLI

And finishes successfully.

Backup 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.

/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/bin/wine --bottle "dbForgeStudioMySQL" --check --wait-children --start "C:\users\crossover\My Documents\backup.bat" 

In this example:

/Applications/CrossOver.app/Contents/SharedSupport/CrossOver/bin/wine

…is the command that initiates CrossOver.

--bottle 'dbForgeStudioMySQL'

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

--check --wait-children --start

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

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

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

Note

You can automate the launch of dbForge Studio from the command line using the standard macOS scheduler.

Use our guide for installing MySQL Server on macOS.