An introduction to backups
In the previous chapter, we learned to define users in MySQL and grant permissions to restrict access to specific users and/or applications, using roles to make this task more efficient, and troubleshooted various database connection issues.
In this chapter, we will learn how to use backups to safeguard against data loss in a number of unfortunate situations, such as outages or even a software update. Besides guarding against data loss, backups also help to validate data – for example, after someone has gained unauthorized access or after a software bug has been discovered.
We will also review the basics of logical backups, before diving into mysqldump
and mysqlpump
, their differences, and how to create full and partial backups with both. We will then proceed with learning how to restore backups and touch upon using binlog
files to do point-in-time restores.