importing a CSV into phpmyadmin

后端 未结 4 1289
情深已故
情深已故 2020-11-29 08:25

I have a CSV that looks like this,

candidate_id,show_on_site,first_name,surname,gender,DOB,showdob,Location,height,eyes,hair_colour,hair_length,accents,union         


        
4条回答
  •  再見小時候
    2020-11-29 08:46

    In phpMyAdmin, click the table, and then click the Import tab at the top of the page.

    Browse and open the csv file. Leave the charset as-is. Uncheck partial import unless you have a HUGE dataset (or slow server). The format should already have selected “CSV” after selecting your file, if not then select it (not using LOAD DATA). If you want to clear the whole table before importing, check “Replace table data with file”. Optionally check “Ignore duplicate rows” if you think you have duplicates in the CSV file. Now the important part, set the next four fields to these values:

    Fields terminated by: ,
    Fields enclosed by: “
    Fields escaped by: \
    Lines terminated by: auto
    

    Currently these match the defaults except for “Fields terminated by”, which defaults to a semicolon.

    Now click the Go button, and it should run successfully.

提交回复
热议问题