Chapter 10. Troubleshooting and Emergencies

After you have a running MySQL database, you want to protect it against disaster. This Chapter deals with backing up and recovering a database, as well as some other unusual system problems you might encounter when working with a MySQL database.

Backing Up

It is vital to back up your data regularly. The actual backup strategy you use depends on many factors, including how often your database is updated and the severity of the consequences of your database being offline.

You should schedule your backups so that, should the worst happen, recovery onto a new database server can be done quickly and with no mission-critical data lost.

Taking a Full Backup

mysqldump --user=user --host=host --port=port \
--password= ...

Get MySQL® Phrasebook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.