Mysqlhotcopy Backup MySQL Database method

Source: Internet
Author: User
Tags install perl


Compare with mysqldump:

1, the former is a fast file in the sense of copy, the latter is a database-side SQL statement collection.
2, the former can only run in the database directory on the machine, the latter may be used in remote clients, but the backup files are still stored on the server.
3, the same place is the online execution of LOCK tables and UNLOCK tables
4, the former restore only need copy backup files to the source directory coverage can be, the latter need to import SQL files to the original library. (source or MySQL < Bakfile.sql)
5, the former only applies to the MyISAM engine, and then can be used at the same time in the MyISAM engine and INODDB engine.
6, the former must install the Perl-dbd-mysql package before using, but the latter does not need.

You need to install PERL-DBI and Dbd-mysql before using mysqlhotcopy:

1, the implementation of Yum install PERL-DBI installation perl-dbi.

2, installation Dbd-mysql please refer to http://www.centos.bz/2011/11/linux-install-perl-dbd-mysql/

Give a common example of backup:

/usr/local/mysql/bin/mysqlhotcopy-u root-p 123456–addtodest database name 1 database name 2 backup directory

–addtodest means that when a backup is present, the backup is not interrupted and only new files are added.

More options are available for performing/usr/local/mysql/bin/mysqlhotcopy–help viewing.

How do I restore MySQL?

1, stop the MySQL server.
2, copy the backup database directory to the MySQL data directory.
3, change the directory owner for the MySQL server running users (such as MySQL).
4, start the MySQL server

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.