MySQL Loading text data

Source: Internet
Author: User

The data inside the text must be separated by the TAB key, and if you need to represent a null value, use \ n to indicate

The database field needs to correspond to the Text tab-key separation as follows:

table field Name,cat

LISI \ n

Zhangsan m

In the database, as in the following method:

LOAD DATA LOCAL INFILE '/path/data.txt ' into TABLE tablename LINES TERMINATED by ' \ r \ n ';

LINES TERMINATED by ' \ r \ n ' for the specified line delimiter default ' \ n ' (that is, the Linux line delimiter), if your machine is an Apple system, please use ' \ r '

This article is from the "Linux Learning path" blog, so be sure to keep this source http://raystudylinux.blog.51cto.com/9065684/1765678

MySQL Loading text 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.