Load data infile: import millions of data entries in an excel file to the database within one minute.

Source: Internet
Author: User

Load data infile: import millions of pieces of data in the excel file into the database in MYSQL within one minute, and use the load data infile command. Step 1: Save the excel file as a csv text. csv files are separated by commas (,). 2. Enter an SQL statement in mysql.

Load data local infile "F:/top20/top2020.csv" into table top20 fields terminated by ',' (dir_1, dir_2, dir_3, keyword, buy, click, ppc );

 

Then execute the SQL statement ~ Note that fields must be placed behind fields terminated by ','; otherwise, an error is returned. The fields terminated by ',' indicates that data of each field is separated by commas in the text. If the Separator in the text is \ t, you do not need to write this field to separate the SQL statement and directly write the entered field. The rest is simple. You can understand it at a glance ~

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.