The following maintenance jobs are typically run against a MySQL database:
- Backup
- Clean-up binary logs
- Optimize tables
- Purge query cache
- Rotate binary logs
Backup
A backup is not a typical maintenance job. But it behaves more or less like one. The backup should be done regularly depending on the restore/PITR (Point in Time Recovery) requirements.
Make sure, that in the backup all the necessary files (data files, transaction log files, configuration files and binary log files) are included. To prove that the backup process is working properly a regular restore should be performed. This can ideally be combined with the set-up of new database instances for developers or testing.
Clean-up the binary logs
The binary logs can be cleaned-up in two ways:
a) Passive by MySQL itself:
# my.cnf expire_logs_days = …[Read more]