title: How to append a mysql table to another table in a different database
body: <p>I would like to grab a table from one database and append this data to a table in another database. However, they have similar numbers (including the id) which need to be updated before they can be copied over. Is there a function available that could do this automatically? Or do I need to write a script in between?</p>
  
  <p>So far I've got:</p>
  
  <pre><code>#!/bin/sh
  mysqldump -uuser1 -ppw1 database1 table1 &gt; /home/user/public_html/database1.sql --skip-add-drop-table --skip-create-options
  mysql -uuser2 -ppw2 database2 &lt; /home/user/public_html/database1.sql
  rm /home/user/public_html/database1.sql
  </code></pre>