title: How to insert csv file data into mysql database
body: <p>I want to insert data into mysql table from csv file. Import data from <a href="https://app.box.com/s/adq2te1d5b5wp71yi145" rel="nofollow noreferrer">region_codes.csv</a> file. In region_codes.csv file having 3 columns in 3rd columns it had <code>,</code> separated data, include those commas how to insert in mysql.</p>
  
  <pre><code>DROP TABLE IF EXISTS `region_codes`;
  CREATE TABLE `region_codes` (
      `country_code` CHAR(2) NULL,
      `region_no` varchar(5) NOT NULL,
      `region` VARCHAR(45) NULL,
      INDEX `idx_country_code` (`country_code`)
  ) COLLATE='utf8_bin' ENGINE = MyISAM;
  </code></pre>
  
  <p>Using <code>LOAD DATA LOCAL INFILE</code> I import the data but only 1000 rows are imported outof 4066 rows.</p>
  
  <pre><code>LOAD DATA LOCAL INFILE 'C:/region_codes.csv' INTO TABLE `region_codes` FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n';
  </code></pre>
  
  <p>How to insert huge amount of data into mysql <code>region_codes</code> table from csv file.</p>
  
  <p><strong>Screenshot:</strong> <img src="https://i.stack.imgur.com/lmLSh.png" alt="Action output of MySql"></p>