MySQL backup data that meets specific criteria

Source: Internet
Author: User

When using MySQL data export for backup, the entire table of data is backed up, sometimes just want to back up part of the data, this time can use the following methods:

1. Use INSERT into and select to combine:

Insert  into  Selectfrom where>= "-  < 9-03 ";

This will back up the data that satisfies the where limit to the new Table_bak table.

2. Use SELECT INTO outfile to back up the data to a file:

SELECT  into OUTFILE "/tmp/result. text  by ' , '  by ' " '  by ' \ n '  from Table_data;

This method requires the operation permissions of the machine running the MySQL service. Some cloud databases do not provide access to the machines running the MySQL service, so this method does not necessarily apply.

3. Mysqldump-w

- -p password table_data–> tmp.dump

This method is not tested.

MySQL backup data that meets specific criteria

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.