title: Trying to do LOAD DATA INFILE with REPLACE and AUTO_INCREMENT
body: <p>I am trying to load a file onto a MySQL database, having the primary key auto_incremented and I would like the data to be updated if i find any duplicate rows. However, the REPLACE keywords only works on primary key, which is auto generated so i'm stuck.</p>
  
  <p>how to be able to have a table with an ID that auto_increments and at the same time to be able to insert/update data from a file using LOAD DATA INFILE?</p>
  
  <p>Here is the table</p>
  
  <pre><code>CREATE TABLE  `oxygen_domain`.`TEST` (
  `TEST_ID` int(11) NOT NULL AUTO_INCREMENT,
  `NAME` varchar(255) NOT NULL,
  `VALUE` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`TEST_ID`,`NAME`,`VALUE`)
  ) 
  </code></pre>
  
  <p>and here is the command</p>
  
  <pre><code>LOAD DATA LOCAL INFILE 'C:/testData.txt'
  REPLACE
  INTO TABLE TEST
  FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
  LINES TERMINATED BY '\r\n'
  IGNORE 1 LINES
  (NAME, VALUE);
  </code></pre>
  
  <p>and here is the sample  data</p>
  
  <pre><code>ignored name, ignored value
  name1,value1
  name2,value2
  name3,value3
  </code></pre>
  
  <p>The wanted ending result after running the command above multiple times withthe above data is</p>
  
  <pre><code>|TEST_ID |NAME |VALUE|
  1, 'name1', 'value1'
  2, 'name2', 'value2'
  3, 'name3', 'value3'
  </code></pre>