MySQL backup through the command line

You can back up and restore data not just using the web interface but through the command line as well. This is done using the Client Tool, an executable file included into all Backup Manager installations (view primary Client Tool instruction).

Here is a sample instruction for MySQL. The current instruction is based on a Linux case. The same workflow can be used on Windows.

  1. Start your terminal emulator and move to the Backup Manager installation directory (this is where ClientTool is located).

    cd /opt/MXB/bin

  2. Configure access to the MySQL server that you want to back up.

    ./ClientTool control.mysqldb.add -name mysqldb -user root -password Aiuq78552v -server-port 3306

    Here are the parameters to submit:

    • -name – assign a name to the MySQL server as it will appear in the Client Tool and Backup Manager. We sypport Latin letters and most punctuation marks. No slashes.
    • -user – your username for access to the MySQL server (we recommend using the root)
    • -password – your password for access to the MySQL server
    • -server-port – the port number of the MySQL server. If in doubt, check the option file on your machine (my.cnf).
  3. Add the MySQL server to your backup selection.

    ./ClientTool control.selection.modify -datasource MySql -include mysqldb

    You can make sure the MySQL server has been included into the backup selection using the control.selection.list command.

  4. Start the backup of the MySQL data source.

    ./ClientTool control.backup.start -datasource MySql

    You can check the current status of the backup session using the control.session.list command.