Import CSV to MySQL

后端 未结 3 2158
慢半拍i
慢半拍i 2020-11-27 04:01

I have created a database and a table. I have also created all the fields I will be needing. I have created 46 fields including one that is my ID for the row. The CSV doesn\

3条回答
  •  醉酒成梦
    2020-11-27 04:29

    Please look at this page and see if it has what you are looking for. Should be all you need since you are dealing with just one table. MYSQL LOAD DATA INFILE

    So for example you might do something like this:

    LOAD DATA INFILE 'filepath' INTO TABLE 'tablename' FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (column2, column3, column4);
    

    That should give you an idea. There are of course more options that can be added as seen in the above link.

提交回复
热议问题