title: How to solve pymysql.err.programmingError during upload using pymysql
body: <p>I want to create a dataframe and update it to mysql.
  If there is a duplicate key, it will be updated and if there is no duplicate key, it will be inserted.</p>
  <pre><code>user = 'test'
  passw = '...'
  host = '...'
  port = '...'
  database = '...'
  conn = pymysql.connect(host=host,
                             port=port,
                             user=user,
                             password=passw,
                             database=database,
                             charset='utf8')
  curs = conn.cursor()
  data = list(dataframe.itertuples(index=False, name=None))
  
  sql = &quot;insert into naversbmapping(brand, startdate, enddate, cost, daycost) values (%s, %s, %s, %s, %s) on duplicate key update brand = %s, startdate = %s, enddate = %s, cost = %s, daycost = %s&quot;
  curs.executemany(sql, data)
  conn.commit()
  conn.close()
  </code></pre>
  <p>However, I get the following error. How do I fix it?</p>
  <pre><code>pymysql.err.ProgrammingError: (1064, &quot;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 '%s, startdate = %s, enddate = %s, cost = %s, daycost = %s' at line 1&quot;)
  )
  </code></pre>