Daily Incremental backup of MYSQL in Linux

Source: Internet
Author: User

In Linux, database backup is very important. If regular backup is performed, the data can be restored to the last normal state in the case of a system crash, minimizing the loss. MySQLl provides a mysqldump command, which can be used for data backup. The following assumes that you want to back up the tm database:

# Mysqldump-u root-p tm> tm_050519. SQL

Enter the password as prompted, and back up all the table structures and data of the tm database to tm_050519. SQL. Because the backup work is always required, if the data volume occupies a large space, in this case, you can use gzip to compress data. The command is as follows:

# Mysqldump-u root-p tm | gzip> tm_050519. SQL .gz

When the system crashes and the system is rebuilt, data can be restored as follows:

# Mysql-u root-p tm <tm_050519. SQL

Direct Recovery from compressed files:

# Gzip <tm_050519. SQL .gz | mysql-u root-p tm

Of course, many MySQL tools provide more intuitive backup and recovery functions, such as phpMyAdmin. However, I think mysqldump is the most basic and common.

2. Using crontab, the system regularly backs up mysql Databases every day.

  • 1
  • 2
  • Next Page

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.