Chapter 29. Database Maintenance

In this chapter, you’ll learn how to perform common database maintenance tasks.

Backing Up Data

Like all data, MySQL data must be backed up regularly. As MySQL databases are disk-based files, normal backup systems and routines can back up MySQL data. However, as those files are always open and in use, normal file copy backup may not always work.

Here are possible solutions to this problem:

  • Use the command line mysqldump utility to dump all database contents to an external file. This utility should ideally be run before regular backups occur so the dumped file will be backed up properly.

  • The command line mysqlhotcopy utility can be used to copy all data from a database (this one is not supported by all database engines). ...

Get MySQL® Crash Course now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.