title: Can I update existing rows in a MYSQL table with rows in a Pandas DataFrame based on an ID that exists in both?
body: <p>I currently have a MYSQL table that I pull into a Pandas DF with the pd.read_sql_query function.</p>
  <p>Example table/DF before added data:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>ID</th>
  <th>Value</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td></td>
  </tr>
  <tr>
  <td>2</td>
  <td></td>
  </tr>
  <tr>
  <td>3</td>
  <td></td>
  </tr>
  <tr>
  <td>4</td>
  <td></td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I then add some data to an existing column in the MYSQL table in Pandas.</p>
  <p>Example DF after added data:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>ID</th>
  <th>Value</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>5</td>
  </tr>
  <tr>
  <td>2</td>
  <td>6</td>
  </tr>
  <tr>
  <td>3</td>
  <td>2</td>
  </tr>
  <tr>
  <td>4</td>
  <td>9</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I then want to update the rows in the MYSQL database based on the ID column.</p>
  <p>I have tried the following:</p>
  <p><code>df.to_sql(con=conn,name='table_name',if_exists='replace',index=False)</code></p>
  <p>However, I specifically want to update the specific rows and not drop and replace the table itself.</p>
  <p>I have tried using SQL Alchemy functions, but I don't have much experience with SQL to implement it correctly.</p>