title: Python how to insert data from dataframe to MySQL
body: <p>I get row of datafram and insert to mysql with this code, res is data I want to insert to mysql.</p>
  
  <pre><code>res = df.loc[df.ID == l_id]
  mycursor = mydb.cursor()
  
  sql = "INSERT INTO log (id, user, number, state, j_id) VALUES (%s, %s, %s, %s, %s )"
  val = [(None, res['User'], res['Pages'] , res['State'], l_id )]
  
  mycursor.executemany(sql, val)
  mydb.commit()
  
  print(mycursor.rowcount, "was inserted.") 
  
  mycursor.close()
  </code></pre>
  
  <p>when I run it show error like this.</p>
  
  <pre><code>ProgrammingError: Failed processing format-parameters; Python 'series' cannot be converted to a MySQL type
  </code></pre>
  
  <p>How to add data from dataframe to MySQL?</p>