Backup and restore of MySQL data

Source: Internet
Author: User

Backup of data:

650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M02/77/A0/wKioL1ZqaNTCLlEcAAB2Jy11-f8740.jpg "title=" 01.jpg "alt=" Wkiol1zqantcllecaab2jy11-f8740.jpg "/>


1: Simple Data Backup (single-table backup)

Through the SELECT statement, the query to the data, in the form of a text file, stored up!

Select field List into file address from table name where other SELECT clauses!

SELECT * into outfile ' e:/vip/stu.txt ' from select_student;

650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M01/77/A2/wKiom1ZqajuSpRFkAACV8sEkAGc954.jpg "title=" 01.jpg "alt=" Wkiom1zqajusprfkaacv8sekagc954.jpg "/>


The delimiter between the default fields, using tabs, and the delimiter between records, use newline characters!

However, it can be set when the data is stored!

650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M02/77/A1/wKioL1Zqa1Gj3avKAACkIuknGDc073.jpg "title=" 01.jpg "alt=" Wkiol1zqa1gj3avkaackiukngdc073.jpg "/>


Cases:

SELECT * into outfile ' e:/vip/stu.csv ' fields terminated by ', ' lines terminated by ' \ r \ n ' from player;


650) this.width=650; "src=" http://s2.51cto.com/wyfs02/M01/77/A2/wKiom1ZqbbeAYSgCAABy7Ck8Q7M413.jpg "title=" 01.jpg "alt=" Wkiom1zqbbeaysgcaaby7ck8q7m413.jpg "/>


Simple data restore:

Load data infile file address into table name;


Backup and restore of MySQL data

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.