Import table data txt_MySQL

Source: Internet
Author: User
Import table data txtmysqlloaddatainfileD: import.txt export tableshop; output: QueryOK, 5 rowsaffected (0.08sec) Records: 5 Deleted: 0 Skipped: 0 Warnings: 0txt file... import table data txt

Mysql> load data infile "D:/import.txt" into table shop; output: Query OK, 5 rows affected (0.08 sec) Records: 5 Deleted: 0 Skipped: 0 Warnings: 0. txt file content: 6 bag 180 jd A 5007 ipad air2 3500 tmall B 500 8 Sony Camera 1800 jd B 200 9 knife 6 tmall A 50010 shoes 300 jd B 80 import and then query the data: mysql> select * from shop; output: + ---- + ------------- + --------- + ------------- + ------ + ------- + | id | name | price | supplier_name | sort | count | + ---- + ------------- + --------- + | 1 | apple | 2.50 | dangdang | A | 500 | 2 | book | 8.50 | tmall | B | 500 | 3 | book | 1.20 | jd | B | 200 | 4 | apple | 1.50 | tmall | A | 500 | 5 | pen | 8.50 | jd | B | 80 | 6 | bag | 180.00 | jd | A | 500 | 7 | ipad air2 | 3500.00 | tmall | B | 500 | 8 | Sony Camera | 1800.00 | jd | B | 200 | 9 | knife | 6.00 | tmall | A | 500 | 10 | shoes | 300.00 | jd | B | 80 | + ---- + ------------- + --------- + --------------- + ------ + ------- + 10 rows in set (0.00 sec)

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.