How to Import a CSV

If you have a CSV file you can import into a table using the load data command of MySQL.

-- The file and the table have the same quantity of columns
LOAD DATA INFILE 'c:/country.csv' 
    INTO TABLE country 
    FIELDS TERMINATED BY ',' 
    ENCLOSED BY '"' 
    LINES TERMINATED BY '\n' 
    IGNORE 1 ROWS

IN THIS PAGE