title: Importing CSV into database using Python
body: <p>I'm trying to import a csv file into a connecting MySQL database using python. However, I keep getting the following error: ProgrammingError: not enough arguments for format string.</p>
  <p>All code runs perfect until: &quot;cursor.execute(&quot; Does anybody have any ideas?</p>
  <p>Code used:</p>
  <pre><code>#Python connect with SQL
  import MySQLdb
  import csv
  import sys
  
  conn = MySQLdb.connect(host=&quot;127.0.0.1&quot;, user=&quot;root&quot;, password=&quot;&quot;, database=&quot;furniture&quot;)
  
  print (&quot;Connected with database&quot;)
  
  cursor = conn.cursor()
  csv_data = csv.reader(open(r&quot;C:\Users\M.schuurman\Downloads\furniture2.csv&quot;))
  header = next(csv_data)
  
  print('Importing the CSV Files')
  
  for row in csv_data:
      print(row)
      cursor.execute(
          &quot;INSERT INTO customer (customerid, customername, pcnumbers, pcletters, street,  number, province) VALUES (%s, %s, %s, %s, %s, %s, %s)&quot;, row)
  
  conn.commit()
  cursor.close()
  print('Done')
  </code></pre>