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: 307

Filed under:
|
|
|

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?

  1. your cvs file's column name must match your table column name
  2. browse your required .csv file
  3. select CSV using LOAD DATA options
  4. Check box 'ON' for Replace table data with file
  5. in Fields terminated by box type ,
  6. in Fields enclosed by box "
  7. in Fields escaped by box \
  8. in Lines terminated by box auto
  9. 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

Related posts about php

Related posts about mysql