Backup MySQL database

There are many different ways to backup a MySQL database. In this case, we will use mysqldump utility provided by MySQL to dump data and table structures from a specific database. It requires the deployment target to have the MySQL installation binaries and local access to the MySQL instance where the database is hosted.

In the following example, we’ll use the MySQL - Backup Database community step template.

Create the Runbook

  1. To create a runbook, navigate to Project ➜ Operations ➜ Runbooks ➜ Add Runbook.
  2. Give the Runbook a name and click SAVE.
  3. Click DEFINE YOUR RUNBOOK PROCESS, then click ADD STEP.
  4. Add a new step template from the community library called MySQL - backup database.
  5. Fill out all the parameters in the step. It’s best practice to use variables rather than entering the values directly in the step parameters:
ParameterDescriptionExample
ServerName or IP of the MySQL serverMySQL1
UsernameUsername with rights to create a databaseroot
PasswordPassword for the user accountMyGreatPassword!
Database NameName of the database to createMyDatabase
PortPort number for the MySQL server3306
Use SSLWhether to use the SSL protocolChecked for True, unchecked for False
MySQL PathPath to binariesC:\Program Files\MySQL\MySQL Server 5.6\bin
Backup DirectoryLocation to store backup fileC:\backups\

This will check if a database exists and backup a database on the MySQL instance.

Help us continuously improve

Please let us know if you have any feedback about this page.

Send feedback

Page updated on Sunday, January 1, 2023