title: Bulk insert using raw sql (mysql) not working with load data infile and ignore # lines
body: <p>I'm trying to insert rows using raw sql in django:</p>
  
  <p>The input file has 15 lines that are "commented out" using '#'.</p>
  
  <p>The rest of the file is tab delimited and terminated by '\n'.</p>
  
  <p>I am trying to ignore the first 15 lines using the IGNORE &lt;#> LINES clause in my LOAD DATA INFILE statement.</p>
  
  <p>using the following code:</p>
  
  <pre><code>def my_custom_sql():
      from django.db import connection, transaction
      cursor = connection.cursor()
      statement = "LOAD DATA LOCAL INFILE '/home/dev/ttam/data/temp.ttam' INTO TABLE ttam_genotypeentry (snp_id, @dummy1, @dummy2, genotype) SET subject_id=%i IGNORE 15 LINES;" % subject.pk
      cursor.execute(statement)
      transaction.commit_unless_managed()
  </code></pre>
  
  <p>i get the following error:</p>
  
  <pre><code>DatabaseError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IGNORE 15 LINES' at line 1")
  </code></pre>
  
  <p>With the statement (removing the IGNORE 15 LINES):</p>
  
  <p><code>statement = "LOAD DATA LOCAL INFILE '/home/dev/ttam/data/temp.ttam' INTO TABLE ttam_genotypeentry (snp_id, @dummy1, @dummy2, genotype) SET subject_id=%i;" % subject.pk</code></p>
  
  <p>I get this error:</p>
  
  <pre><code>IntegrityError: (1452, 'Cannot add or update a child row: a foreign key constraint fails (`ttam_genotypeentry`, CONSTRAINT `snp_id_refs_rs_id_50bcd16b` FOREIGN KEY (`snp_id`) REFERENCES `ttam_snp` (`rs_id`))')
  </code></pre>
  
  <p>If i manually remove the first 15 lines of the input file, the operation continues without issue.</p>
  
  <p>I am using:</p>
  
  <p>django: <code>Django version 1.3 rc 1</code></p>
  
  <p>mysql: <code>Server version: 5.1.49-1ubuntu8.1 (Ubuntu)</code></p>
  
  <p>How do i ignore the first 15 lines of my input file?</p>