Backup of MySQL

Source: Internet
Author: User

Usemysqldump Command

Backup:
    

    1. # mysqldump -u root -p test > mysql_backup_201411202.sql  

follow the prompts to enter the password, which willTestdatabase All table structure and data backup tomysql_backup_201411202. SQL, if the amount of data is large, you canUsegzipto compress the data, the command is as follows:
    

    1. # mysqldump -u root -p test | gzip > mysql_backup_201411202.sql.gz

Backup to a remote machine, using - H specified, such as

    1. # mysqldump -u root -p test > mysql_backup_201411202.sql -h xxx.xxx.xxx.xxx 

can be backed up directly toIPaddress isxxx.xxx.xxx.xxxof the remote computer.
when the system crashes, rebuilds the system, or recovers the database, you can recover the data like this:
   

    1.  # mysql -u root -p test < mysql_backup_201411202.sql

To restore directly from a compressed file:
    

    1. # gunzip < mysql_backup_201411202.sql.gz | mysql -u root -p test

Online data collation



From for notes (Wiz)



Backup of MySQL

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.