title: Fastest way to load .xlsx file into MySQL database
body: <p>I'm trying to import data from a .xlsx file into a SQL database. 
  Right now, I have a python script which uses the openpyxl and MySQLdb modules to </p>
  
  <ul>
  <li>establish a connection to the database</li>
  <li>open the workbook</li>
  <li>grab the worksheet</li>
  <li>loop thru the rows the the worksheet, extracting the columns I need
  and inserting each record into the database, one by one</li>
  </ul>
  
  <p>Unfortunately, this is painfully slow. I'm working with a huge data set, so I need to find a faster way to do this (preferably with Python). Any ideas?</p>
  
  <pre><code>wb = openpyxl.load_workbook(filename="file", read_only=True)
  ws = wb['My Worksheet']
  
  conn = MySQLdb.connect()
  cursor = conn.cursor()
  
  cursor.execute("SET autocommit = 0")
  
  for row in ws.iter_rows(row_offset=1):
       sql_row = # data i need
       cursor.execute("INSERT sql_row")
  
  conn.commit() 
  </code></pre>