title: how can i add only the new rows into mysql database table from datafram?
body: <ol>
  <li><p>i wrote i python code that requsts an api and collect data existed on this api in a dataframe named <strong>df2</strong></p>
  </li>
  <li><p>i created a mysql database named <strong>speed_data</strong>
  the code bellow allowed me to add the data existed in my dataframe into my SQLdatabase :</p>
  </li>
  </ol>
  <pre><code>
  try:
      conn = msql.connect(host='localhost',database='speed_data' ,user='root',  
                          password='')
      if conn.is_connected():
          cursor = conn.cursor()
          cursor.execute(&quot;select database();&quot;)
          record = cursor.fetchone()
          print(&quot;You're connected to database: &quot;, record)
          
          cursor.execute(&quot;DROP TABLE IF EXISTS speed_cord;&quot;)
          print('creating table.....')
          
          cursor.execute(&quot;CREATE TABLE speed_cord(id varchar(20),vitesse_med varchar(20),vitesse_max varchar(20),distance varchar(20),temps timestamp,PRIMARY KEY(id)) &quot;)
          print(&quot;table is created....&quot;)
          
          for i,row in df2.iterrows():
               
              sql = &quot;INSERT INTO speed_data.speed_cord VALUES (%s,%s,%s,%s,%s)&quot;
              cursor.execute(sql, tuple(row))
              print(&quot;Record inserted&quot;)
              # the connection is not auto committed by default, so we must commit to save our changes
              conn.commit()
  
  except Error as e:
      print(&quot;Error while connecting to MySQL&quot;, e)
  </code></pre>
  <ol start="3">
  <li>now when i request the api evry time it returns new rows in my datafram <strong>df2</strong> and i need to add only these new rows to my table <strong>speed_cord</strong> without dropping  the first data</li>
  </ol>
  <p>how can i do that?</p>