Back up the MySQL database. Copy it directly!

Source: Internet
Author: User

We all know that there are three common methods for MySQL database backup: Direct Copy (cp, tar, gzip, cpio), MySQLdump, and MySQLhotcopy, the following articles mainly introduce the practical application of using direct copy database backup.

1. Use Direct Copy Database Backup

Typical utilities such as cp, tar, or cpio.

When using the direct backup method, you must ensure that the table is not used. If the server changes a table while you are copying it, the copy will be meaningless.

The best way to ensure your copy integrity is to close the server, copy files, and restart the server. If you do not want to shut down the server, you must lock the server while performing the table check. If the server is running, the same constraints apply to copying files, and you should use the same locking protocol to make the server "quiet ".

When you have completed the MySQL database backup, you need to restart the server if it is disabled) or release the lock added to the table if you want the server to run ).

To copy a database from one machine to another, just copy the file to the appropriate data directory of another server host. Make sure the file is in MyIASM format or the two machines have the same hardware structure. Otherwise, your database has strange content on another host. You should also ensure that the servers on the other machine do not access them when you are installing database tables.


The above content is a common solution introduction to MySQL database backup. I hope you will find some gains.

Edit recommendations]

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.