Mysql data import _ MySQL

Source: Internet
Author: User
Mysql data import bitsCN.com

1. data file format (in C:/test. bat ):

Name, Age, IncomeRange, Education, Skills, Social, isPaidAlbert, 23, 0, 0, 3, 3, 0Alexandra, 25, 1, 2, 4, 2, 0Athena, 24, 0, 1, 3, 4, 0Aurora, 23, 1, 2, 5, 2, 0Babis, 21, 0, 0, 3, 4, 0Bill, 31, 1, 2, 4, 2, 0Bob, 32, 1, 1, 3, 1, 1Carl, 30, 0, 2, 4, 2, 0Catherine, 31, 1, 1, 3, 3, 0Charlie, 30, 1, 2, 3, 2, 0Constantine, 37, 1, 1, 3, 2, 0Dmitry, 35, 2, 2, 1, 1, 1Elena, 38, 1, 1, 3, 2, 0Eric, 37, 2, 2, 2, 2, 0Frank, 39, 3, 1, 3, 1, 1George, 42, 2, 2, 2, 1, 1Jack, 43, 3, 1, 1, 1, 1John, 45, 4, 2, 1, 1, 1Maria, 43, 2, 1, 3, 1, 0Lukas, 45, 3, 2, 1, 1, 1

2. execute the import language:

CREATE DATABASE iweb2;USE iweb2;CREATE TABLE sf_users (Name VARCHAR(250) NOT NULL PRIMARY KEY, Age INT NOT NULL, IncomeRange INT NOT NULL,            Education INT NOT NULL, Skills INT NOT NULL, Social INT NOT NULL, isPaid INT NOT NULL);                       LOAD DATA INFILE 'C://test.dat' INTO TABLE sf_users FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '/n' IGNORE 1 LINES;

3. import result:

BitsCN.com

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.