title: Python and MySQLdb warnings
body: <p>I have a program that is exporting MSSQL data and importing it into MySQL. I have a function that is importing as follows:</p>
  
  <pre><code>def importMySql (mycursor,exportedfilename,table,delimiter):
      file_loc = str(sys.path[0] +"\\" +exportedfilename.lower()+".out").replace("\\", "\\\\")
      mycursor.execute("LOAD DATA LOCAL INFILE '%s' INTO TABLE %s FIELDS TERMINATED BY '%s' LINES TERMINATED BY '\r\n'" %(str(file_loc), table, delimiter))
  </code></pre>
  
  <p>the cursor (MySQLdb) is raising the following warnings:</p>
  
  <pre><code>C:\Users\tfy\Documents\PyProj\UTL (Export, Import, RDF)\eic.py:98: Warning: Data truncated for column 'DateofCharges' at row 1194
    mycursor.execute("LOAD DATA LOCAL INFILE '%s' INTO TABLE %s FIELDS TERMINATED BY '%s' LINES TERMINATED BY '\r\n'" %(str(file_loc), table, delimiter))
  C:\Users\tfy\Documents\PyProj\UTL (Export, Import, RDF)\eic.py:98: Warning: Data truncated for column 'DateofCharges' at row 2009
    mycursor.execute("LOAD DATA LOCAL INFILE '%s' INTO TABLE %s FIELDS TERMINATED BY '%s' LINES TERMINATED BY '\r\n'" %(str(file_loc), table, delimiter))
  C:\Users\tfy\Documents\PyProj\UTL (Export, Import, RDF)\eic.py:98: Warning: Data truncated for column 'DateofCharges' at row 4793
    mycursor.execute("LOAD DATA LOCAL INFILE '%s' INTO TABLE %s FIELDS TERMINATED BY '%s' LINES TERMINATED BY '\r\n'" %(str(file_loc), table, delimiter))
  </code></pre>
  
  <p>but I need to control the warning to only output: </p>
  
  <pre><code>Warning: Data truncated for column 'DateofCharges' at row 1194
  Warning: Data truncated for column 'DateofCharges' at row 2009
  Warning: Data truncated for column 'DateofCharges' at row 4739
  </code></pre>
  
  <p>I have looked around and found plenty of information that illustrates hows to create custom warnings. However, not sure how I would achieve the above. I do not want to turn off the warnings, I just want to "format" them. I thought about editing the actual MySQLdb file but it is in .egg format and unable to do that. I also played around <code>warning.format()</code> but was unsuccessful. </p>
  
  <p>Thanks!</p>