26.5. Backup and Restore Capabilities


The Backup and Restore sections of the MySQL Administrator main window enable you to generate database backups as text files and to perform data recovery operations using those backup files.

26.5.1. Making Backups

The Backup section provides an interface to MySQL Administrator's backup-generation capabilities. MySQL Administrator creates backup files that contain SQL statements such as CREATE TABLE and INSERT that can be reloaded into your MySQL server to re-create databases and tables. These files are similar to the SQL-format backup files generated by mysqldump.

Backups are based on projects. A project is a named set of specifications that you can execute to perform a backup based on those specifications. Projects can be browsed and selecting a project allows you to examine and modify its specifications. The project approach enables you to easily select from among multiple types of backups.

A database browser allows you to specify which databases to use for a project. By default, all tables in a selected database are selected for backup, but you can include or exclude individual tables.

Backup projects include a name to use for the output file. By default, the same name is used every time you execute the project, which causes the file to be overwritten each time. To prevent this, there is an option for adding the date and time to the end of backup files so that a different file is written for each project execution. (This also makes it easy to tell at a glance when a given backup file was created.) The option to enable date-tagging is accessed from the Administrator section of the Options dialog. (See Section 3.6, "The Options Dialog.")

You can control several aspects of backup operation, such as whether to use locking that is more appropriate for MyISAM or InnoDB tables, and the style to use for INSERT statements (single-row versus multiple-row, ANSI-style identifier quoting, and so forth).

Projects can be executed on demand or scheduled for periodic execution at daily, weekly, or monthly intervals. For weekly backups, you can select which day or days of the week on which to execute the project. A monthly backup can be executed on any single day of the month.

26.5.2. Restoring Backups

The Restore section provides an interface to MySQL Administrator's data-recovery capabilities. MySQL Administrator can reload SQL-format dump files containing statements such as CREATE TABLE and INSERT that recreate the dumped tables. The destination where tables are created can be chosen as each table's original database, or you can restore all tables to an existing database or to a new database.

To enable you to restore only part of a dump file, MySQL Administrator provides a dump file analysis feature: Select a dump file, and MySQL Administrator reads it to determine what tables it will restore and presents a dialog showing you what the tables are. You can selectively include or exclude each table to control which ones to reload when MySQL Administrator processes the dump file. This is useful when you want to restore only certain tables from a full-database dump.



MySQL 5 Certification Study Guide
MySQL 5.0 Certification Study Guide
ISBN: 0672328127
EAN: 2147483647
Year: 2006
Pages: 312

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net