title: MYSQL LOAD DATA INFILE ignore duplicate rows (autoincrement as primary key)
body: <p>I ran into some trouble using LOAD DATA INFILE command as i wanted to ignore the lines that was already in the data base..say if i have a table with data as follows,</p>
  
  <pre><code>id  |name   |age
  --------------------
  1   |aaaa   |22
  2   |bbbb   |21
  3   |bbaa   |20
  4   |abbb   |22
  5   |aacc   |22
  </code></pre>
  
  <p>Where id is auto increment value. an the csv file i have contains data as follows,</p>
  
  <pre><code>"cccc","14"
  "ssee","33"
  "dddd","22"
  "aaaa","22"
  "abbb","22"
  "dhgg","34"
  "aacc","22"
  </code></pre>
  
  <p>I want to ignore the rows,</p>
  
  <pre><code>    "aaaa","22"
      "abbb","22"
      "aacc","22"
  </code></pre>
  
  <p>and upload the rest to the table. and the query i have yet which uploads everything to the table is as follows,</p>
  
  <pre><code>    LOAD DATA INFILE 'member.csv'
      INTO TABLE tbl_member
      FIELDS TERMINATED BY ','
             ENCLOSED BY '"'
             ESCAPED BY '"'
             LINES TERMINATED BY '\n'
      (name, age);
  </code></pre>
  
  <p>PLEASE help me on this task.. It will be much appreciated..i tried many links but did not help :(</p>