Import CSV to mysql
Posted
by 404error
on Stack Overflow
See other posts from Stack Overflow
or by 404error
Published on 2010-06-11T19:28:40Z
Indexed on
2010/06/11
19:32 UTC
Read the original article
Hit count: 304
I have created a database and table. I have also created all the fields i will be needing. I have created 46 fields including 1 that is my ID for the row. The CSV doesn't contain the id field, nor does it contain the headers for the columns. I am new to all of this but have been trying to figure this out. I'm not on here being lazy asking for the answer, but looking for direction.
I'm trying to figure out how to import the CSV but have it start importing data starting at the 2nd field, since I'm hoping the auto_increment will fill in the ID field, which is the first field i created.
I tried these instructions with now luck. Can anyone offer some insight?
- your cvs file's column name must match your table column name
- browse your required .csv file
- select CSV using LOAD DATA options
- Check box 'ON' for Replace table data with file
- in Fields terminated by box type ,
- in Fields enclosed by box "
- in Fields escaped by box \
- in Lines terminated by box auto
- in Column names box type column name seperated by , like column1,column2,column3 10 check box ON for Use LOCAL keyword.
© Stack Overflow or respective owner