royalflush5
royalflush5

Reputation: 57

Importing csv into MySQL

I've got a csv file I made with a bunch of info, but I cant get it to import properly...

Ive got these values in info.csv: id firstname lastname address state gpa credits

following a video, I used this:

LOAD DATA LOCAL INFILE '/IT101/info.csv' INTO TABLE 'student' FIELDS TERMINATED BY ','
 ENCLOSED BY '"' ESCAPED BY '\' LINES TERMINATED BY '\n';

I get back:

PAGER set to stdout

and the values aren't there. What am I doing wrong?

EDIT: By the way, I alaready have two rows in the table from using insert into, just doing it 30 more times seemed like a waste of time

Upvotes: 1

Views: 113

Answers (1)

Dipak G.
Dipak G.

Reputation: 725

You can try...

LOAD DATA INFILE '/IT101/info.csv' 
INTO TABLE students 
FIELDS TERMINATED BY ',' 
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 ROWS;

Upvotes: 1

Related Questions