Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2016
    Posts
    1

    Unanswered: Importing from CSV file into Mysql table

    Hi,

    I am new to mysql and am trying to import a simple 2 column csv file into a table which has 2 fields and an auto increment id field.

    countries table has ID INT, country char(40), flag char(80). It's basically a table of country names and flag image locations.

    I am using LOAD DATA INFILE 'countries.csv' into table countries FIELDS TERMINATED BY ',' (country, flag) SET ID=NULL;

    In theory it should come out with an auto generated ID code and the rest of the data from the csv file. However, check out the image to see what is actually happening maybe it's something very simple, but its got me scratching my head.

    Click image for larger version. 

Name:	Image1.jpg 
Views:	6 
Size:	132.1 KB 
ID:	17189

    Any suggestions would really be appreciated.

    Thanks,

    Andrew

  2. #2
    Join Date
    Jan 2017
    Posts
    18
    Follow this link:

    stackoverflow.com/questions/3635166/how-to-import-csv-file-to-mysql-table

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •