My (SQL) WorkLog: mysqlhotcopy

Friday, June 19, 2009

mysqlhotcopy

mysqlhotcopy is a Perl script that uses LOCK TABLES, FLUSH TABLES, and cp or scp to make a database backup quickly. It is the fastest way to make a backup of the database or single tables, but it can be run only on the same machine where the database directories are located. mysqlhotcopy works only for backing up MyISAM and ARCHIVE tables. It runs on Unix and NetWare.


The options can be viewed by executing the following command:
shell>mysqlhotcopy --help


Backup one/many database at once

shell>mysqlhotcopy [options] db_name1...db_nameN /path/to/backup_directory

Using mysqlhotcopy to backup only those tables within a given database that match a regular expression:

shell>mysqlhotcopy [options] db_name./regex/

The regular expression for the table name can be negated by prefixing it with a tilde (“~”):


shell>mysqlhotcopy [options] db_name./~regex/

For complete info on mysqlhotcopy
http://dev.mysql.com/doc/refman/5.1/en/mysqlhotcopy.html



No comments:

Post a Comment