Mysql outfile infile import and export data

Source: Internet
Author: User

Mysql outfile infile import and export data export [plain] SELECT * into outfile '/tmp/jason.txt 'fields TERMINATED by', 'From test. jason; or [plain] SELECT * into outfile '/tmp/jason1.txt' fields terminated by ', 'optionally enclosed by' "'Lines terminated by '\ n' FROM test. jason1; output: "00:06:56", "100000198108800", "EXPORT_INFO", "BUY_ITEM_INNER", 100, "11", "2", "00:06:59 ", "1068029027", "EXPORT_INFO", "BUY_ITEM_INNER", 100000198108800, "11", "2", 70 "00:08:27", "", "EXPORT_INFO ", "BUY_ITEM_INNER", "11", "2", 20 import [plain] load data infile '/tmp/jason.txt' into table aa. jason fields terminated by ','; or [plain] load data infile '/tmp/jason1.txt' into table aa. jason1 fields terminated by ', 'optionally enclosed by' "'Lines terminated by '\ n'; summary: fields terminated ', 'Field delimiter optionally enclosed by '"' will enclose the field and the number of invalid lines terminated by '\ n' line break mysqldump also has the same function [plain] mysqldump-uroot-p-T /tmp test fi -- fields-enclosed-by = \ "-- fields-terminated-by =" \ t "fi is the exported file name. Export export .txt test is the exported database name-T/tmp is the exported directory location -- fields-enclosed-by = \ "indicates that each data is enclosed in double quotation marks. -- fields-terminated-by =" \ t "indicates that each data is separated by a tab.

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.