FSR270223 & FSR150323:- Mysql loading csv into the table

LOAD DATA LOCAL INFILE ‘location of csv file’ INTO TABLE departments FIELDS TERMINATED BY ‘,’ ENCLOSED BY ‘"’ LINES TERMINATED BY ‘\n’ IGNORE 1 ROWS;

replace the “location of csv file” with the location of your csv file.

if you find any error.

  1. SET GLOBAL local_infile=1;
  2. QUIT
    connect to the server with local-infile system variable
  3. mysql local_infile=1 -u root -p;
1 Like