Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

MySQL Backup: Backing Up Your Database

Follow the steps below when the business library needs to generate backup files daily, hourly, or continuously in a fixed window.

Steps to follow

  1. Confirm app.toml, bak.toml, prj.toml exist; tune MySQL, output dir, encryption, and upload in bak.toml. bak.toml must include:
[public]
bak_type = "db"
db_type = "mysql"
bak_location_type = "local"   # or local_and_remote

[mysql]
mysql_ip = "127.0.0.1"
mysql_port = 3306
mysql_user_name = "your_user"
mysql_pwd = "your_password"
mysqldump_path = "/path/to/mysqldump"
# skip_ssl = true             # Enable when TLS cert is untrusted

Specify the library name to back up in `prj.toml’:

[local]
prj_key = "your_project"
mysql_db_name = "your_db"
  1. When the certificate chain of the target MySQL is not trusted by the local client, it is decided whether to set skip_ssl in combination with the actual environment.
  2. Perform a check first to confirm that the connection and configuration can be read normally:
peppykeep backup run --bak-type db --config-home /path/to/conf
  1. Perform a formal backup after the output is correct:
peppykeep backup run --apply --bak-type db --config-home /path/to/conf
  1. When retaining only local files, explicitly add --no-upload:
peppykeep backup run --apply --bak-type db --config-home /path/to/conf --no-upload
  1. When uploading to the object store immediately after this task, explicitly add --upload:
peppykeep backup run --apply --bak-type db --config-home /path/to/conf --upload

results verification

  • ‘BakType’ is’ Db `in the pre-check or execute output (or Action indicates a database backup).
  • The backup file has been generated at the location specified in the configuration.
  • .ppk when not encrypted; .ppke when encryption is on.
  • The number of local history files matches this configuration.

When you need to process multiple libraries at once under the same MySQL instance, check Bulk backup of multiple MySQL libraries with the same instance.

Order Details: