title: Python + MySQLdb executemany
body: <p>I'm using Python and its MySQLdb module to import some measurement data into a Mysql database. The amount of data that we have is quite high (currently about ~250 MB of csv files and plenty of more to come).</p>
  
  <p>Currently I use cursor.execute(...) to import some metadata. This isn't problematic as there are only a few entries for these.</p>
  
  <p>The problem is that when I try to use cursor.executemany() to import larger quantities of the actual measurement data, MySQLdb raises a</p>
  
  <pre><code>TypeError: not all arguments converted during string formatting
  </code></pre>
  
  <p>My current code is</p>
  
  <pre><code>def __insert_values(self, values):
      cursor = self.connection.cursor()
      cursor.executemany("""
          insert into values (ensg, value, sampleid)
          values (%s, %s, %s)""", values)
      cursor.close()
  </code></pre>
  
  <p>where <code>values</code> is a list of tuples containing three strings each. Any ideas what could be wrong with this?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>The values are generated by</p>
  
  <pre><code>yield (prefix + row['id'], row['value'], sample_id)
  </code></pre>
  
  <p>and then read into a list one thousand at a time where row is and iterator coming from <code>csv.DictReader</code>.</p>